From 2a8f4cdd0ca8b4b6d006827fa4a7bd0ac2a8a17e Mon Sep 17 00:00:00 2001 From: daywiss Date: Sat, 27 Jul 2019 06:59:10 -0400 Subject: [PATCH] path resolve configs to current wd --- libs/utils.js | 24 ------------------------ start.js | 3 ++- 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/libs/utils.js b/libs/utils.js index 3f3cafe..1ddc8d7 100644 --- a/libs/utils.js +++ b/libs/utils.js @@ -40,30 +40,6 @@ exports.objectFilter = (filter = {}) => obj => { }, true ) - //return lodash.reduce( - // filter, - // (result, value, key) => { - // //did the filter pass - // if (result === false) return false - // //cast filter params to an array - // value = lodash.castArray(value) - // //check the object for the key - // const check = lodash.get(obj, key) - // // console.log(obj,filter) - // if (lodash.isArray(check)) { - // if (check.length === 0 && value.length === 0) return true - // // return lodash.intersection(check, value).length > 0 - // // check each value in the path to ensure complete match. - // return value.reduce((result, val, i) => { - // if (val == check[i]) return result - // return false - // }, true) - // } else { - // return value.includes(check) - // } - // }, - // true - //) } exports.timeout = (promise, delay, message) => { diff --git a/start.js b/start.js index cd32e15..0be21f5 100644 --- a/start.js +++ b/start.js @@ -4,13 +4,14 @@ const args = require('minimist')(process.argv.slice(2)) const assert = require('assert') const lodash = require('lodash') const App = require('./libs/app') +const Path = require('path') const paths = args._ || [] let config = lodash.reduce( paths, (result, fn) => { - return lodash.merge(result, require('./' + fn)) + return lodash.merge(result, Path.resolve(process.cwd(),fn)) }, {} )