click twice to open folder after start vscode (fixes #9834)

This commit is contained in:
Benjamin Pasero
2016-08-08 09:41:20 +02:00
parent ee55203ad4
commit b91c182be4
+8 -2
View File
@@ -91,7 +91,7 @@ export class StorageService implements IStorageService {
private load(): any {
try {
return JSON.parse(fs.readFileSync(this.dbPath).toString());
return JSON.parse(fs.readFileSync(this.dbPath).toString()); // invalid JSON or permission issue can happen here
} catch (error) {
if (this.envService.cliArgs.verboseLogging) {
console.error(error);
@@ -102,6 +102,12 @@ export class StorageService implements IStorageService {
}
private save(): void {
fs.writeFileSync(this.dbPath, JSON.stringify(this.database, null, 4));
try {
fs.writeFileSync(this.dbPath, JSON.stringify(this.database, null, 4)); // permission issue can happen here
} catch (error) {
if (this.envService.cliArgs.verboseLogging) {
console.error(error);
}
}
}
}