Skip to content

Commit

Permalink
fix: Add fix for build script and characters that could cause issues
Browse files Browse the repository at this point in the history
  • Loading branch information
whomwah committed Oct 9, 2024
1 parent 0b09e97 commit 1f49806
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[
"@semantic-release/exec",
{
"prepareCmd": "./bin/build_release ${nextRelease.version} \"UPDATING TO: ${nextRelease.version}\""
"prepareCmd": "./bin/build_release ${nextRelease.version} \"${nextRelease.notes}\""
}
],
[
Expand Down
14 changes: 13 additions & 1 deletion bin/build_release
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ set -e
VERSION=$1
NOTES=$2

# Function to escape special characters for XML
escape_for_xml() {
echo "$1" | sed -e 's/&/\&amp;/g' -e 's/</\&lt;/g' -e 's/>/\&gt;/g' -e 's/"/\&quot;/g' -e "s/'/\&apos;/g"
}

echo "updating VERSION to $VERSION in info.plist... ✅"
/usr/libexec/PlistBuddy -c "Set :version $VERSION" info.plist

Expand All @@ -25,7 +30,14 @@ To view other releases visit:
https://github.com/whomwah/alfred-github-workflow/releases
END
)
/usr/libexec/PlistBuddy -c "Set :readme $readme$NOTES$finishup" info.plist

# Escape NOTES content
escaped_notes=$(escape_for_xml "$NOTES")

# Combine readme, escaped notes, and finishup
combined_notes="$readme$escaped_notes$finishup"

/usr/libexec/PlistBuddy -c "Set :readme $readme$escaped_notes$finishup" info.plist

echo "bundle and minify workflow... ✅"
deno bundle mod.ts | esbuild --minify-whitespace --minify-identifiers > mod.min.js
Expand Down

0 comments on commit 1f49806

Please sign in to comment.