Skip to content

Commit 63143f4

Browse files
committed
Fix recursion creation of the 'sketch' folder in the output (microsoft#683)
1 parent 6c31579 commit 63143f4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/arduino/arduino.ts

+9
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ export class ArduinoApp {
149149

150150
args.push("--pref", `build.path=${outputPath}`);
151151
arduinoChannel.info(`Please see the build logs in Output path: ${outputPath}`);
152+
153+
fs.unlinkSync(path.join(outputPath, "build.options.json"));
154+
util.rmdirRecursivelySync(path.join(outputPath, "sketch"));
152155
} else {
153156
const msg = "Output path is not specified. Unable to reuse previously compiled files. Upload could be slow. See README.";
154157
arduinoChannel.warning(msg);
@@ -214,6 +217,9 @@ export class ArduinoApp {
214217

215218
args.push("--pref", `build.path=${outputPath}`);
216219
arduinoChannel.info(`Please see the build logs in Output path: ${outputPath}`);
220+
221+
fs.unlinkSync(path.join(outputPath, "build.options.json"));
222+
util.rmdirRecursivelySync(path.join(outputPath, "sketch"));
217223
} else {
218224
const msg = "Output path is not specified. Unable to reuse previously compiled files. Upload could be slow. See README.";
219225
arduinoChannel.warning(msg);
@@ -276,6 +282,9 @@ export class ArduinoApp {
276282

277283
args.push("--pref", `build.path=${outputPath}`);
278284
arduinoChannel.info(`Please see the build logs in Output path: ${outputPath}`);
285+
286+
fs.unlinkSync(path.join(outputPath, "build.options.json"));
287+
util.rmdirRecursivelySync(path.join(outputPath, "sketch"));
279288
} else {
280289
const msg = "Output path is not specified. Unable to reuse previously compiled files. Verify could be slow. See README.";
281290
arduinoChannel.warning(msg);

0 commit comments

Comments
 (0)