提交 b91c182b 编写于 作者: B Benjamin Pasero

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

上级 ee55203a
......@@ -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);
}
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册