mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-13 14:26:37 +00:00
#1191: fixed default sketchbook URI for _save as_
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
This commit is contained in:
parent
b62f3dec84
commit
581379f86f
@ -77,15 +77,11 @@ export class SaveAsSketch extends SketchContribution {
|
|||||||
const exists = await this.fileService.exists(
|
const exists = await this.fileService.exists(
|
||||||
sketchDirUri.resolve(sketch.name)
|
sketchDirUri.resolve(sketch.name)
|
||||||
);
|
);
|
||||||
const defaultUri = exists
|
const defaultUri = sketchDirUri.resolve(
|
||||||
? sketchDirUri.resolve(
|
exists
|
||||||
sketchDirUri
|
? `${sketch.name}_copy_${dateFormat(new Date(), 'yyyymmddHHMMss')}`
|
||||||
.resolve(
|
: sketch.name
|
||||||
`${sketch.name}_copy_${dateFormat(new Date(), 'yyyymmddHHMMss')}`
|
);
|
||||||
)
|
|
||||||
.toString()
|
|
||||||
)
|
|
||||||
: sketchDirUri.resolve(sketch.name);
|
|
||||||
const defaultPath = await this.fileService.fsPath(defaultUri);
|
const defaultPath = await this.fileService.fsPath(defaultUri);
|
||||||
const { filePath, canceled } = await remote.dialog.showSaveDialog({
|
const { filePath, canceled } = await remote.dialog.showSaveDialog({
|
||||||
title: nls.localize(
|
title: nls.localize(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user