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

Commit 37a53e8

Browse files
elektronikworkshophlovdal
authored andcommitted
* Fixed bug with build: initializing cocopa too early (was failing if sketch wasn't initialized)
* More info in error message for uncaught exception during build cleanup * Note on output path preparation which seems to be a bit wonky
1 parent 69a29f4 commit 37a53e8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/arduino/arduino.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ export class ArduinoApp {
183183
this._building = false;
184184
logger.notifyUserError("ArduinoApp.build",
185185
reason,
186-
`Unhandled exception when cleaning up build (${mode}).`);
186+
`Unhandled exception when cleaning up build "${mode}": ${JSON.stringify(reason)}`);
187187
return false;
188188
});
189189
}
@@ -465,7 +465,6 @@ Please make sure the folder is not occupied by other procedures .`);
465465
const dc = DeviceContext.getInstance();
466466
const args: string[] = [];
467467
let restoreSerialMonitor: boolean = false;
468-
const cocopa = makeCompilerParserContext(dc);
469468
const verbose = VscodeSettings.getInstance().logLevel === constants.LogLevel.Verbose;
470469

471470
if (!this.boardManager.currentBoard) {
@@ -544,6 +543,8 @@ Please make sure the folder is not occupied by other procedures .`);
544543
arduinoChannel.start(`${mode} sketch '${dc.sketch}'`);
545544

546545
if (buildDir || dc.output) {
546+
// 2020-02-29, EW: This whole code appears a bit wonky to me.
547+
// What if the user specifies an output directory "../builds/my project"
547548
buildDir = path.resolve(ArduinoWorkspace.rootPath, buildDir || dc.output);
548549
const dirPath = path.dirname(buildDir);
549550
if (!util.directoryExistsSync(dirPath)) {
@@ -589,6 +590,8 @@ Please make sure the folder is not occupied by other procedures .`);
589590
// Push sketch as last argument
590591
args.push(path.join(ArduinoWorkspace.rootPath, dc.sketch));
591592

593+
const cocopa = makeCompilerParserContext(dc);
594+
592595
const cleanup = async (result: "ok" | "error") => {
593596
let ret = true;
594597
if (result === "ok") {

0 commit comments

Comments
 (0)