Open Save as... dialog when saving sketches for the first time (#579)

* Properly recognize temporary sketches in macOS

Without this fix, sketches report their URI path as /private/var/xxx
whereas `os.tmpdir()` returns /var/xxx. The second path can be turned
into the first by resolving symlinks, which gives a canonical path to
compare against.

* Open Save as... dialog when saving sketches for the first time
This commit is contained in:
Federico Bond
2021-11-10 12:46:24 -03:00
committed by GitHub
parent 3b04d8df26
commit 437caeb348
2 changed files with 18 additions and 1 deletions

View File

@@ -387,7 +387,7 @@ void loop() {
async isTemp(sketch: Sketch): Promise<boolean> {
let sketchPath = FileUri.fsPath(sketch.uri);
let temp = os.tmpdir();
let temp = await promisify(fs.realpath)(os.tmpdir());
// Note: VS Code URI normalizes the drive letter. `C:` will be converted into `c:`.
// https://github.com/Microsoft/vscode/issues/68325#issuecomment-462239992
if (isWindows) {