Skip to content

Commit

Permalink
🐛 add a safeguard if read-pkg-up didn't set the returned path correc…
Browse files Browse the repository at this point in the history
Closes #35
  • Loading branch information
ngryman committed May 30, 2020
1 parent aaa96ba commit 247b365
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ async function loadConfig() {
.then(getConfig)

const readFromLocalCzrc = () =>
readPkg().then(res => (res ? readFromCzrc(`${path.dirname(res.path)}/.czrc`) : null))
readPkg().then(res =>
res && res.path ? readFromCzrc(`${path.dirname(res.path)}/.czrc`) : null
)

const readFromGlobalCzrc = () => readFromCzrc(homeDir('.czrc'))

Expand Down

0 comments on commit 247b365

Please sign in to comment.