Browse Source

Fix bug where configuration file doesn't save

pull/6/head
hewenyang 7 years ago
parent
commit
bd35d0d15f
  1. 1
      app.js
  2. 2
      utility.js

1
app.js

@ -32,6 +32,7 @@ const options = commandLineArgs(optionDefinitions);
global.syzoj = { global.syzoj = {
rootDir: __dirname, rootDir: __dirname,
config: require(options.config), config: require(options.config),
configDir: options.config,
models: [], models: [],
modules: [], modules: [],
db: null, db: null,

2
utility.js

@ -363,6 +363,6 @@ module.exports = {
}, },
async saveConfig() { async saveConfig() {
let fs = require('fs-extra'); let fs = require('fs-extra');
fs.writeFileAsync(syzoj.rootDir + '/config.json', JSON.stringify(syzoj.config, null, 2)); fs.writeFileAsync(syzoj.configDir, JSON.stringify(syzoj.config, null, 2));
} }
}; };

Loading…
Cancel
Save