Skip to content

Commit

Permalink
path resolve configs to current wd
Browse files Browse the repository at this point in the history
  • Loading branch information
daywiss committed Jul 27, 2019
1 parent 4833fc3 commit 2a8f4cd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 25 deletions.
24 changes: 0 additions & 24 deletions libs/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
3 changes: 2 additions & 1 deletion start.js
Original file line number Diff line number Diff line change
Expand Up @@ -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))
},
{}
)
Expand Down

0 comments on commit 2a8f4cd

Please sign in to comment.