测试自动构建

This commit is contained in:
masnn committed 2020-04-14 16:45:11 +08:00
1 parent 06f1b5bc62
commit 9cb68397b9
9 files changed
+127 -13

No files matched your search

+9 -5
View File
@@ -1,8 +1,9 @@
const
yaml = require('js-yaml'),
{ defaultsDeep } = require('lodash'),
fs = require('fs'),
path = require('path');
os = require('os'),
path = require('path'),
yaml = require('js-yaml'),
{ defaultsDeep } = require('lodash');
let options = {
db: {
@@ -46,9 +47,12 @@ let options = {
};
try {
let t = yaml.safeLoad(fs.readFileSync(path.resolve(process.cwd(), 'config.yaml')));
let f = path.resolve(process.cwd(), 'config.yaml');
if (!fs.existsSync(f)) f = path.resolve(os.homedir(), '.config', 'hydro', 'config.yaml');
if (!fs.existsSync(f)) f = path.resolve('/config/config.yaml');
let t = yaml.safeLoad(fs.readFileSync(f));
options = defaultsDeep(t, options);
} catch (e) {
console.error('Cannot load config');
}
module.exports = options;
module.exports = options;