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

Commit 251f307

Browse files
authored
Merge pull request #1269 from Falven/build_prefs_fix
Issue #1268 Fixed pref arguments when using CLI.
2 parents 7b40a2f + 86680e4 commit 251f307

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
}
@@ -639,7 +644,11 @@ export class ArduinoApp {
639644
for (const pref of dc.buildPreferences) {
640645
// Note: BuildPrefSetting makes sure that each preference
641646
// value consists of exactly two items (key and value).
642-
args.push("--pref", `${pref[0]}=${pref[1]}`);
647+
if (this.useArduinoCli()) {
648+
args.push("--build-property", `${pref[0]}=${pref[1]}`);
649+
} else {
650+
args.push("--pref", `${pref[0]}=${pref[1]}`);
651+
}
643652
}
644653
}
645654

0 commit comments

Comments
 (0)