fix(shell-arduino): 修复 --libraries 参数格式,改用单独的 --library 参数
This commit is contained in:
@@ -11,13 +11,19 @@ export default class ShellArduino extends Shell {
|
|||||||
async compile(config) {
|
async compile(config) {
|
||||||
let arduino = _.merge({}, ARDUINO);
|
let arduino = _.merge({}, ARDUINO);
|
||||||
arduino = _.merge(arduino, config);
|
arduino = _.merge(arduino, config);
|
||||||
|
|
||||||
|
// 为每个 library 路径生成单独的 --library 参数
|
||||||
|
const libraryArgs = arduino.path.libraries
|
||||||
|
.map(lib => `--library "${lib}"`)
|
||||||
|
.join(' ');
|
||||||
|
|
||||||
const command = [
|
const command = [
|
||||||
`"${arduino.path.cli}"`,
|
`"${arduino.path.cli}"`,
|
||||||
'compile',
|
'compile',
|
||||||
'-b', arduino.key,
|
'-b', arduino.key,
|
||||||
'--config-file', `"${arduino.path.config}"`,
|
'--config-file', `"${arduino.path.config}"`,
|
||||||
'--verbose',
|
'--verbose',
|
||||||
'--libraries', `"${arduino.path.libraries.join('","')}"`,
|
libraryArgs,
|
||||||
'--build-path', `"${arduino.path.build}"`,
|
'--build-path', `"${arduino.path.build}"`,
|
||||||
'--output-dir', `"${arduino.path.output}"`,
|
'--output-dir', `"${arduino.path.output}"`,
|
||||||
`"${arduino.path.code}"`,
|
`"${arduino.path.code}"`,
|
||||||
@@ -29,6 +35,12 @@ export default class ShellArduino extends Shell {
|
|||||||
async upload(config) {
|
async upload(config) {
|
||||||
let arduino = _.merge({}, ARDUINO);
|
let arduino = _.merge({}, ARDUINO);
|
||||||
arduino = _.merge(arduino, config);
|
arduino = _.merge(arduino, config);
|
||||||
|
|
||||||
|
// 为每个 library 路径生成单独的 --library 参数
|
||||||
|
const libraryArgs = arduino.path.libraries
|
||||||
|
.map(lib => `--library "${lib}"`)
|
||||||
|
.join(' ');
|
||||||
|
|
||||||
const command = [
|
const command = [
|
||||||
`"${arduino.path.cli}"`,
|
`"${arduino.path.cli}"`,
|
||||||
'compile',
|
'compile',
|
||||||
@@ -37,7 +49,7 @@ export default class ShellArduino extends Shell {
|
|||||||
'-b', arduino.key,
|
'-b', arduino.key,
|
||||||
'--config-file', `"${arduino.path.config}"`,
|
'--config-file', `"${arduino.path.config}"`,
|
||||||
'--verbose',
|
'--verbose',
|
||||||
'--libraries', `"${arduino.path.libraries.join('","')}"`,
|
libraryArgs,
|
||||||
'--build-path', `"${arduino.path.build}"`,
|
'--build-path', `"${arduino.path.build}"`,
|
||||||
'--output-dir', `"${arduino.path.output}"`,
|
'--output-dir', `"${arduino.path.output}"`,
|
||||||
`"${arduino.path.code}"`,
|
`"${arduino.path.code}"`,
|
||||||
|
|||||||
Reference in New Issue
Block a user