Skip to content

Commit 502f658

Browse files
committedSep 13, 2018
fix: bail if lockfilePath is unavailble see #194
1 parent eb0cbfb commit 502f658

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed
 

‎update.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,13 @@ module.exports = function update () {
6161
const doCommit = allPackageFiles.reduce((didChange, pkgJson) => {
6262
const lockfilePath = path.dirname(pkgJson)
6363
const previousDir = process.cwd()
64-
process.chdir(lockfilePath)
64+
65+
try {
66+
process.chdir(lockfilePath)
67+
} catch (error) {
68+
console.error(`can't chdir into lockfile path ${lockfilePath}`)
69+
return
70+
}
6571

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

0 commit comments

Comments
 (0)