Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

Commit f848790

Browse files
Merge pull request #408 from APIs-guru/fixYarn
Fix `yarn` cmd. check the length of npm_config_argv in prepublish
2 parents 6fc7baf + 7e3b0b0 commit f848790

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

resources/prepublish.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Because of a long-running npm issue (https://github.com/npm/npm/issues/3059)
22
# prepublish runs after `npm install` and `npm pack`.
33
# In order to only run prepublish before `npm publish`, we have to check argv.
4-
if node -e "process.exit(($npm_config_argv).original[0].indexOf('pu') === 0)"; then
4+
if node -e "process.exit(($npm_config_argv).original.length > 0 && ($npm_config_argv).original[0].indexOf('pu') === 0)"; then
55
exit 0
66
fi
77

0 commit comments

Comments
 (0)