add sample-node-config.json

This commit is contained in:
zhandouxiaojiji committed 2020-10-14 21:08:54 +08:00
1 parent e58ae18f79
commit 78aec1afb1
3 files changed
+19 -3

No files matched your search

+6 -1
View File
@@ -1,6 +1,7 @@
import * as fs from 'fs';
const settingPath = 'settings.json';
const sampleNodeConfig = 'sample-node-config.json'
export interface SettingsModel {
recentWorkspaces?: string[];
@@ -18,7 +19,7 @@ export default class Settings {
this.settings = {
recentWorkspaces: [],
recentFiles: [],
nodeConfigPath: ''
nodeConfigPath: sampleNodeConfig,
};
this.save();
}
@@ -33,6 +34,10 @@ export default class Settings {
get recentFiles() {
return this.settings.recentFiles;
}
get nodeConfig() {
const str = fs.readFileSync(this.nodeConfigPath, 'utf8');
return JSON.parse(str);
}
set(config: SettingsModel) {
this.settings = {