From a8b683e9dbd6498011cb015da5e613dd14f0a8d6 Mon Sep 17 00:00:00 2001 From: rgot-org <31351194+rgot-org@users.noreply.github.com> Date: Fri, 17 Mar 2023 09:26:06 +0100 Subject: [PATCH 1/4] Update arduinoSettings.ts --- src/arduino/arduinoSettings.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/arduino/arduinoSettings.ts b/src/arduino/arduinoSettings.ts index 60e8ebea..e49e6d19 100644 --- a/src/arduino/arduinoSettings.ts +++ b/src/arduino/arduinoSettings.ts @@ -214,6 +214,8 @@ export class ArduinoSettings implements IArduinoSettings { this._packagePath = path.join(this._arduinoPath, "portable"); } else if (util.fileExistsSync(path.join(this._arduinoPath, "AppxManifest.xml"))) { this._packagePath = path.join(folder, "ArduinoData"); + } else if (process.env.hasOwnProperty('ARDUINO_DIRECTORIES_DATA')) { + this._packagePath = process.env.ARDUINO_DIRECTORIES_DATA } else { this._packagePath = path.join(process.env.LOCALAPPDATA, "Arduino15"); } From f54759834e841b81bf392a442650a32651698d34 Mon Sep 17 00:00:00 2001 From: rgot-org <31351194+rgot-org@users.noreply.github.com> Date: Fri, 17 Mar 2023 10:49:52 +0100 Subject: [PATCH 2/4] Update arduinoSettings.ts --- src/arduino/arduinoSettings.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arduino/arduinoSettings.ts b/src/arduino/arduinoSettings.ts index e49e6d19..ecbbc229 100644 --- a/src/arduino/arduinoSettings.ts +++ b/src/arduino/arduinoSettings.ts @@ -219,7 +219,7 @@ export class ArduinoSettings implements IArduinoSettings { } else { this._packagePath = path.join(process.env.LOCALAPPDATA, "Arduino15"); } - + if (this.preferences.get("sketchbook.path")) { if (util.directoryExistsSync(path.join(this._arduinoPath, "portable"))) { this._sketchbookPath = path.join(this._arduinoPath, "portable", this.preferences.get("sketchbook.path")); From 0062c732afcc33e5567f5959f77d34ac1e6691df Mon Sep 17 00:00:00 2001 From: rgot-org <31351194+rgot-org@users.noreply.github.com> Date: Fri, 17 Mar 2023 10:56:14 +0100 Subject: [PATCH 3/4] Revert "Update arduinoSettings.ts" This reverts commit a8b683e9dbd6498011cb015da5e613dd14f0a8d6. --- src/arduino/arduinoSettings.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/arduino/arduinoSettings.ts b/src/arduino/arduinoSettings.ts index ecbbc229..8baced2e 100644 --- a/src/arduino/arduinoSettings.ts +++ b/src/arduino/arduinoSettings.ts @@ -214,8 +214,6 @@ export class ArduinoSettings implements IArduinoSettings { this._packagePath = path.join(this._arduinoPath, "portable"); } else if (util.fileExistsSync(path.join(this._arduinoPath, "AppxManifest.xml"))) { this._packagePath = path.join(folder, "ArduinoData"); - } else if (process.env.hasOwnProperty('ARDUINO_DIRECTORIES_DATA')) { - this._packagePath = process.env.ARDUINO_DIRECTORIES_DATA } else { this._packagePath = path.join(process.env.LOCALAPPDATA, "Arduino15"); } From 8b77fbdf69fe4da38e03ed88c0468114dedd5727 Mon Sep 17 00:00:00 2001 From: rgot-org <31351194+rgot-org@users.noreply.github.com> Date: Fri, 17 Mar 2023 10:59:59 +0100 Subject: [PATCH 4/4] add ARDUINO_DIRECTORIES_DATA environnement variable as packagePath as describe here https://arduino.github.io/arduino-cli/0.28/configuration/#environment-variables add the ARDUINO_DIRECTORIES_DATA to define package directory --- src/arduino/arduinoSettings.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/arduino/arduinoSettings.ts b/src/arduino/arduinoSettings.ts index 8baced2e..9a2f7720 100644 --- a/src/arduino/arduinoSettings.ts +++ b/src/arduino/arduinoSettings.ts @@ -214,10 +214,11 @@ export class ArduinoSettings implements IArduinoSettings { this._packagePath = path.join(this._arduinoPath, "portable"); } else if (util.fileExistsSync(path.join(this._arduinoPath, "AppxManifest.xml"))) { this._packagePath = path.join(folder, "ArduinoData"); + } else if (process.env.hasOwnProperty('ARDUINO_DIRECTORIES_DATA')) { + this._packagePath = process.env.ARDUINO_DIRECTORIES_DATA } else { this._packagePath = path.join(process.env.LOCALAPPDATA, "Arduino15"); } - if (this.preferences.get("sketchbook.path")) { if (util.directoryExistsSync(path.join(this._arduinoPath, "portable"))) { this._sketchbookPath = path.join(this._arduinoPath, "portable", this.preferences.get("sketchbook.path"));