mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 17:19:48 +01:00
click twice to open folder after start vscode (fixes #9834)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user