Skip to content

Commit

Permalink
fix(plugins): use printf for same behavior on different machines
Browse files Browse the repository at this point in the history
  • Loading branch information
dalisoft committed Apr 25, 2024
1 parent 1f2aa15 commit 503accd
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion plugins/PLUGIN_TEMPLATE.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
set -eu

release() {
echo "Template for plug-in"
printf "%s" "Template for plug-in"
}
2 changes: 1 addition & 1 deletion plugins/changelog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ release() {
CONTENT="\n$(cat CHANGELOG.md)"
fi
rm -rf CHANGELOG.md
printf "%s%s" "$RELEASE_BODY" "$CONTENT" >>CHANGELOG.md
printf "%b%b" "$RELEASE_BODY" "$CONTENT" >>CHANGELOG.md
log "Generated Changelog!"
else
log "Skipped Changelog creation in DRY-RUN mode..."
Expand Down
2 changes: 1 addition & 1 deletion plugins/github-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ release() {
"https://api.github.com/repos/$GIT_REPO_NAME/releases" \
-d "{\"tag_name\":\"$NEXT_RELEASE_TAG\",\"target_commitish\":\"$CHECKOUT_SHA\",\"name\":\"$NEXT_RELEASE_TAG\",\"body\":\"$RELEASE_BODY\",\"draft\":false,\"prerelease\":$PRE_RELEASE_VERSION,\"generate_release_notes\":false,\"make_latest\":\"true\"}"
log "Created GitHub release [$NEXT_RELEASE_TAG]!"
echo "GitHub release available at https://github.com/$GIT_REPO_NAME/releases/tag/$NEXT_RELEASE_TAG"
log "GitHub release available at https://github.com/$GIT_REPO_NAME/releases/tag/$NEXT_RELEASE_TAG"
else
log "Skipped GitHub release [$NEXT_RELEASE_TAG] in DRY-RUN mode."
fi
Expand Down
6 changes: 3 additions & 3 deletions plugins/npm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ release() {

if ! $IS_DRY_RUN; then
TEMP_FILE=$(mktemp)
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >>"$TEMP_FILE"
printf "%s\n" "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >>"$TEMP_FILE"

# Bump `package.json` `version` for properly publishing
sed -i.bak "s/\"version\": \"[^\"]*\",/\"version\": \"$NEXT_BUILD_VERSION\",/" "package.json"
Expand All @@ -18,13 +18,13 @@ release() {
export NODE_AUTH_TOKEN="$NPM_TOKEN"
npm publish "$NEXT_RELEASE_VERSION" --userconfig "$TEMP_FILE"

echo "Published [$NEXT_RELEASE_TAG]!"
log "Published [$NEXT_RELEASE_TAG]!"
rm -rf "$TEMP_FILE"
else
log "Skipped npm tag [$NEXT_RELEASE_TAG] in DRY-RUN mode."
fi
else
echo "
printf "%s\n" "
npm Token is not found
Please export npm Token so this plugin can be used
"
Expand Down

0 comments on commit 503accd

Please sign in to comment.