Skip to content

Commit

Permalink
fix(plugins/npm): make it work on both Linux/macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
dalisoft committed Mar 1, 2024
1 parent 6e9043b commit bc28361
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion plugins/npm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ release() {
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >>"$TEMP_FILE"

# Bump `package.json` `version` for properly publishing
sed -i '' "s/\"version\": \"[^\"]*\",/\"version\": \"$NEXT_BUILD_VERSION\",/" "package.json"
if [[ "$(uname)" == "Darwin" ]]; then
# BSD sed
sed -i '' "s/\"version\": \"[^\"]*\",/\"version\": \"$NEXT_BUILD_VERSION\",/" "package.json"
elif [[ "$(uname)" == "Linux" ]]; then
# GNU sed
sed -i "s/\"version\": \"[^\"]*\",/\"version\": \"$NEXT_BUILD_VERSION\",/" "package.json"
fi

export NODE_AUTH_TOKEN="$NPM_TOKEN"
npm publish "$NEXT_RELEASE_VERSION" --userconfig "$TEMP_FILE"
Expand Down

0 comments on commit bc28361

Please sign in to comment.