Skip to content
This repository was archived by the owner on Sep 2, 2020. It is now read-only.

Commit a85445d

Browse files
committed
fix prepublish script by checking argv length
1 parent 80a14dc commit a85445d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

resources/prepublish.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ if (config.scripts.prepublish.indexOf('node ') !== 0) {
2929

3030
// Bail unless we're running during `npm publish`.
3131
var argv = JSON.parse(process.env.npm_config_argv).original;
32-
var isPublishing = argv[0].indexOf('pu') === 0;
32+
var isPublishing = argv.length > 0 && argv[0].indexOf('pu') === 0;
3333
if (!isPublishing) {
3434
process.exit(0);
3535
}

0 commit comments

Comments
 (0)