fix workspace

This commit is contained in:
zhandouxiaojiji committed 2020-11-04 20:20:47 +08:00
1 parent 70cc4dca87
commit 627d061bf0
2 files changed
+11 -9

No files matched your search

+10 -8
View File
@@ -20,16 +20,18 @@ export default class Workspace {
}
load() {
if(!this.filepath) {
if (!this.filepath) {
return;
}
const str = fs.readFileSync(this.filepath, 'utf8');
const data = JSON.parse(str);
this.nodeConfPath = data.nodeConfPath;
this.workdir = data.workdir;
this.initNodeConf();
try {
const str = fs.readFileSync(this.filepath, 'utf8');
const data = JSON.parse(str);
this.nodeConfPath = data.nodeConfPath;
this.workdir = data.workdir;
this.initNodeConf();
} catch (error) {
console.log(error);
}
}
private initNodeConf() {