Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
Akos Kitta 2020-09-04 13:16:31 +02:00 committed by Akos Kitta
parent 7a37aa2e2f
commit 524fbbdf40

View File

@ -382,7 +382,11 @@ void loop() {
}
const newName = path.basename(destination);
try {
await fs.rename(path.join(destination, new URI(sketch.mainFileUri).path.base), path.join(destination, `${newName}.ino`));
const oldPath = path.join(destination, new URI(sketch.mainFileUri).path.base);
const newPath = path.join(destination, `${newName}.ino`);
if (oldPath !== newPath) {
await fs.rename(oldPath, newPath);
}
await this.loadSketch(destinationUri); // Sanity check.
resolve();
} catch (e) {