Skip to content

Commit

Permalink
chore: refactor to pass options object
Browse files Browse the repository at this point in the history
  • Loading branch information
bahmutov committed Apr 7, 2018
1 parent d91d5e6 commit 65488b0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin/deps-ok.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ const options = {
skipBower: false,
allowDuplicate: toArray(argv['allow-duplicate'])
}
const ok = check(dir, Boolean(argv.verbose));
const ok = check(dir, options);
debug('deps check finished with boolean %j', ok)
process.exit(ok ? SUCCESS : FAIL_EXIT_CODE);
7 changes: 6 additions & 1 deletion src/check-folder.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,14 @@ function isFile(path) {
fs.statSync(path).isFile();
}

function checkDependenciesInFolder(folder, verbose, skipBower) {
function checkDependenciesInFolder(folder, options) {
la(is.unemptyString(folder), 'missing folder string', folder)
la(is.object(options), 'expected an options object', options)

debug('folder', folder)
debug('options', options)
const verbose = options.verbose
const skipBower = options.skipBower

if (isFile(folder)) {
if (verbose) {
Expand Down

0 comments on commit 65488b0

Please sign in to comment.