Browse Source

Add configuration path support.

master
t123yh 7 years ago
parent
commit
a3d5cc5c8e
  1. 9
      app.js
  2. 61
      package-lock.json
  3. 1
      package.json

9
app.js

@ -22,9 +22,16 @@
let fs = require('fs'), let fs = require('fs'),
path = require('path'); path = require('path');
const commandLineArgs = require('command-line-args');
const optionDefinitions = [
{ name: 'config', alias: 'c', type: String, defaultValue: './config.json' },
];
const options = commandLineArgs(optionDefinitions);
global.syzoj = { global.syzoj = {
rootDir: __dirname, rootDir: __dirname,
config: require('./config.json'), config: require(options.config),
models: [], models: [],
modules: [], modules: [],
db: null, db: null,

61
package-lock.json generated

@ -87,6 +87,14 @@
"sprintf-js": "1.0.3" "sprintf-js": "1.0.3"
} }
}, },
"array-back": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/array-back/-/array-back-2.0.0.tgz",
"integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==",
"requires": {
"typical": "2.6.1"
}
},
"array-equal": { "array-equal": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz",
@ -364,6 +372,16 @@
"delayed-stream": "1.0.0" "delayed-stream": "1.0.0"
} }
}, },
"command-line-args": {
"version": "4.0.7",
"resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-4.0.7.tgz",
"integrity": "sha512-aUdPvQRAyBvQd2n7jXcsMDz68ckBJELXNzBybCHOibUWEg0mWTnaYCSRU8h9R+aNRSvDihJtssSRCiDRpLaezA==",
"requires": {
"array-back": "2.0.0",
"find-replace": "1.0.3",
"typical": "2.6.1"
}
},
"commander": { "commander": {
"version": "2.8.1", "version": "2.8.1",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.8.1.tgz", "resolved": "https://registry.npmjs.org/commander/-/commander-2.8.1.tgz",
@ -979,6 +997,25 @@
"unpipe": "1.0.0" "unpipe": "1.0.0"
} }
}, },
"find-replace": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/find-replace/-/find-replace-1.0.3.tgz",
"integrity": "sha1-uI5zZNLZyVlVnziMZmcNYTBEH6A=",
"requires": {
"array-back": "1.0.4",
"test-value": "2.1.0"
},
"dependencies": {
"array-back": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/array-back/-/array-back-1.0.4.tgz",
"integrity": "sha1-ZEun8JX3/898Q7Xw3DnTwfA8Bjs=",
"requires": {
"typical": "2.6.1"
}
}
}
},
"find-up": { "find-up": {
"version": "1.1.2", "version": "1.1.2",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz",
@ -3627,6 +3664,25 @@
"terraformer": "1.0.8" "terraformer": "1.0.8"
} }
}, },
"test-value": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/test-value/-/test-value-2.1.0.tgz",
"integrity": "sha1-Edpv9nDzRxpztiXKTz/c97t0gpE=",
"requires": {
"array-back": "1.0.4",
"typical": "2.6.1"
},
"dependencies": {
"array-back": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/array-back/-/array-back-1.0.4.tgz",
"integrity": "sha1-ZEun8JX3/898Q7Xw3DnTwfA8Bjs=",
"requires": {
"typical": "2.6.1"
}
}
}
},
"through": { "through": {
"version": "2.3.8", "version": "2.3.8",
"resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
@ -3758,6 +3814,11 @@
"resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c="
}, },
"typical": {
"version": "2.6.1",
"resolved": "https://registry.npmjs.org/typical/-/typical-2.6.1.tgz",
"integrity": "sha1-XAgOXWYcu+OCWdLnCjxyU+hziB0="
},
"uid-safe": { "uid-safe": {
"version": "2.1.4", "version": "2.1.4",
"resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-2.1.4.tgz", "resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-2.1.4.tgz",

1
package.json

@ -27,6 +27,7 @@
"async-lock": "^0.3.9", "async-lock": "^0.3.9",
"body-parser": "^1.15.2", "body-parser": "^1.15.2",
"cheerio": "^1.0.0-rc.1", "cheerio": "^1.0.0-rc.1",
"command-line-args": "^4.0.7",
"cookie-parser": "^1.4.3", "cookie-parser": "^1.4.3",
"cssfilter": "0.0.10", "cssfilter": "0.0.10",
"csurf": "^1.9.0", "csurf": "^1.9.0",

Loading…
Cancel
Save