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

Commit c65e228

Browse files
committed
Fix recursion creation of the 'sketch' folder in the output (#683)
1 parent be59bd8 commit c65e228

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/arduino/arduino.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ export class ArduinoApp {
154154

155155
args.push("--pref", `build.path=${outputPath}`);
156156
arduinoChannel.info(`Please see the build logs in Output path: ${outputPath}`);
157+
158+
fs.unlinkSync(path.join(outputPath, "build.options.json"));
159+
util.rmdirRecursivelySync(path.join(outputPath, "sketch"));
157160
} else {
158161
const msg = "Output path is not specified. Unable to reuse previously compiled files. Upload could be slow. See README.";
159162
arduinoChannel.warning(msg);
@@ -224,6 +227,9 @@ export class ArduinoApp {
224227

225228
args.push("--pref", `build.path=${outputPath}`);
226229
arduinoChannel.info(`Please see the build logs in Output path: ${outputPath}`);
230+
231+
fs.unlinkSync(path.join(outputPath, "build.options.json"));
232+
util.rmdirRecursivelySync(path.join(outputPath, "sketch"));
227233
} else {
228234
const msg = "Output path is not specified. Unable to reuse previously compiled files. Upload could be slow. See README.";
229235
arduinoChannel.warning(msg);
@@ -286,6 +292,9 @@ export class ArduinoApp {
286292

287293
args.push("--pref", `build.path=${outputPath}`);
288294
arduinoChannel.info(`Please see the build logs in Output path: ${outputPath}`);
295+
296+
fs.unlinkSync(path.join(outputPath, "build.options.json"));
297+
util.rmdirRecursivelySync(path.join(outputPath, "sketch"));
289298
} else {
290299
const msg = "Output path is not specified. Unable to reuse previously compiled files. Verify could be slow. See README.";
291300
arduinoChannel.warning(msg);
@@ -688,4 +697,4 @@ Please make sure the folder is not occupied by other procedures .`);
688697
throw new Error("No sketch file was found.");
689698
}
690699
}
691-
}
700+
}

0 commit comments

Comments
 (0)