Fixed Save As when overwriting existing sketch.

Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
Akos Kitta
2020-12-11 11:40:35 +01:00
committed by Akos Kitta
parent 3191a09562
commit f1bffaab2d
4 changed files with 54 additions and 4 deletions

View File

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