From 21f9992b6a2d3a8d35b259958146198cfc08288e Mon Sep 17 00:00:00 2001 From: sorcerer_com Date: Sat, 12 Jan 2019 16:47:25 +0200 Subject: [PATCH] Fix recursion creation of the 'sketch' folder in the output (#683) --- src/arduino/arduino.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/arduino/arduino.ts b/src/arduino/arduino.ts index 0e10f505..ede8f561 100644 --- a/src/arduino/arduino.ts +++ b/src/arduino/arduino.ts @@ -154,6 +154,9 @@ export class ArduinoApp { args.push("--pref", `build.path=${outputPath}`); arduinoChannel.info(`Please see the build logs in Output path: ${outputPath}`); + + fs.unlinkSync(path.join(outputPath, "build.options.json")); + util.rmdirRecursivelySync(path.join(outputPath, "sketch")); } else { const msg = "Output path is not specified. Unable to reuse previously compiled files. Upload could be slow. See README."; arduinoChannel.warning(msg); @@ -224,6 +227,9 @@ export class ArduinoApp { args.push("--pref", `build.path=${outputPath}`); arduinoChannel.info(`Please see the build logs in Output path: ${outputPath}`); + + fs.unlinkSync(path.join(outputPath, "build.options.json")); + util.rmdirRecursivelySync(path.join(outputPath, "sketch")); } else { const msg = "Output path is not specified. Unable to reuse previously compiled files. Upload could be slow. See README."; arduinoChannel.warning(msg); @@ -286,6 +292,9 @@ export class ArduinoApp { args.push("--pref", `build.path=${outputPath}`); arduinoChannel.info(`Please see the build logs in Output path: ${outputPath}`); + + fs.unlinkSync(path.join(outputPath, "build.options.json")); + util.rmdirRecursivelySync(path.join(outputPath, "sketch")); } else { const msg = "Output path is not specified. Unable to reuse previously compiled files. Verify could be slow. See README."; arduinoChannel.warning(msg);