From 19d13df8864846b61e8a1c159aaa27b5ff9a54b7 Mon Sep 17 00:00:00 2001 From: Christian Weichel Date: Thu, 9 May 2019 09:31:04 +0200 Subject: [PATCH] Fix sketch upload --- arduino-ide-extension/src/node/core-service-impl.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arduino-ide-extension/src/node/core-service-impl.ts b/arduino-ide-extension/src/node/core-service-impl.ts index a5f55218..2f014ca6 100644 --- a/arduino-ide-extension/src/node/core-service-impl.ts +++ b/arduino-ide-extension/src/node/core-service-impl.ts @@ -76,10 +76,11 @@ export class CoreServiceImpl implements CoreService { console.log('upload', options); const { uri } = options; - const sketchpath = await this.fileSystem.getFsPath(options.uri); - if (!sketchpath) { + const sketchFilePath = await this.fileSystem.getFsPath(options.uri); + if (!sketchFilePath) { throw new Error(`Cannot resolve filesystem path for URI: ${uri}.`); } + const sketchpath = path.dirname(sketchFilePath); const currentBoard = await this.boardsService.getSelectBoard(); if (!currentBoard) {