Skip to content

Commit

Permalink
fix(bin): do not error out when there is no config found
Browse files Browse the repository at this point in the history
Closes #43
  • Loading branch information
Kent C. Dodds committed Aug 29, 2016
1 parent c487ea0 commit d07f678
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/bin/p-s.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,12 @@ function getPSConfig() {
if (program.require) {
preloadModule(program.require)
}
const config = loadConfig(program.config || findUp.sync('package-scripts.js'))
const configFilepath = program.config || findUp.sync('package-scripts.js')
if (!configFilepath) {
log.warn(colors.yellow('Unable to find a config file and none was specified.'))
return {scripts: {}} // empty config
}
const config = loadConfig(configFilepath)
if (!config) {
process.exit(FAIL_CODE)
}
Expand Down

0 comments on commit d07f678

Please sign in to comment.