Skip to content

Commit

Permalink
fix: bail if lockfilePath is unavailble see #194
Browse files Browse the repository at this point in the history
  • Loading branch information
janl committed Sep 13, 2018
1 parent eb0cbfb commit 502f658
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion update.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,13 @@ module.exports = function update () {
const doCommit = allPackageFiles.reduce((didChange, pkgJson) => {
const lockfilePath = path.dirname(pkgJson)
const previousDir = process.cwd()
process.chdir(lockfilePath)

try {
process.chdir(lockfilePath)
} catch (error) {
console.error(`can't chdir into lockfile path ${lockfilePath}`)
return
}

const pkg = relative('./package.json')

Expand Down

0 comments on commit 502f658

Please sign in to comment.