Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

Commit 44fb476

Browse files
committed
Fixed pref arguments when using CLI.
1 parent 18b5b3e commit 44fb476

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/arduino/arduino.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,13 @@ export class ArduinoApp {
134134
*/
135135
public async setPref(key, value) {
136136
try {
137-
await util.spawn(this._settings.commandPath,
138-
["--pref", `${key}=${value}`, "--save-prefs"]);
137+
if (this.useArduinoCli()) {
138+
await util.spawn(this._settings.commandPath,
139+
["--build-property", `${key}=${value}`]);
140+
} else {
141+
await util.spawn(this._settings.commandPath,
142+
["--pref", `${key}=${value}`, "--save-prefs"]);
143+
}
139144
} catch (ex) {
140145
}
141146
}
@@ -632,7 +637,11 @@ export class ArduinoApp {
632637
for (const pref of dc.buildPreferences) {
633638
// Note: BuildPrefSetting makes sure that each preference
634639
// value consists of exactly two items (key and value).
635-
args.push("--pref", `${pref[0]}=${pref[1]}`);
640+
if (this.useArduinoCli()) {
641+
args.push("--build-property", `${pref[0]}=${pref[1]}`);
642+
} else {
643+
args.push("--pref", `${pref[0]}=${pref[1]}`);
644+
}
636645
}
637646
}
638647

0 commit comments

Comments
 (0)