测试自动构建

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

+1 -1
View File
@@ -5,7 +5,7 @@ const
builtin = require('./model/builtin'),
pwhash = require('./lib/pwhash'),
options = require('./options'),
{ udoc } = require('../interfaces');
{ udoc } = require('./interface');
async function run() {
let mongourl = 'mongodb://';
-1
View File
@@ -1,4 +1,3 @@
const { ObjectID } = require('bson');
exports.udoc = {
_id: 0,
mail: '',
+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;