fix: relaxed condition to check if resource exists

The original (`fs-extra`-based) implementation did not check if the
file is writable either.

Resources are not writable in mounted AppImages.

Closes #1586

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
This commit is contained in:
Akos Kitta 2022-11-03 16:43:34 +01:00 committed by Akos Kitta
parent 103acc4b7e
commit cc2d557706

View File

@ -660,7 +660,7 @@ export class SketchesServiceImpl
private async exists(pathLike: string): Promise<boolean> {
try {
await fs.access(pathLike, constants.R_OK | constants.W_OK);
await fs.access(pathLike, constants.R_OK);
return true;
} catch {
return false;