mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-06-20 11:06:32 +00:00
arduino/arduino-pro-ide#336: Fixed 'Save As...'
Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
parent
7a37aa2e2f
commit
524fbbdf40
@ -382,7 +382,11 @@ void loop() {
|
|||||||
}
|
}
|
||||||
const newName = path.basename(destination);
|
const newName = path.basename(destination);
|
||||||
try {
|
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.
|
await this.loadSketch(destinationUri); // Sanity check.
|
||||||
resolve();
|
resolve();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user