Add success message and remove newlines

This commit is contained in:
Cam McHenry
2024-03-18 19:49:02 +00:00
parent 032c0af29a
commit 34dcf61506

View File

@@ -47,12 +47,14 @@ jobs:
# then trim the list to remove any leading or trailing whitespace.
CHANGED_FILES=$(git diff --ignore-space-at-eol --name-only dist/ | grep -vE "$FILES_TO_IGNORE" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
if [ -n "$CHANGED_FILES" ]; then
echo "\n❗️ Detected uncommitted changes after build (see diff output below)." >&2
echo "❗️ Detected uncommitted changes after build (see diff output below)." >&2
echo "This indicates that the dist/ directory is out of sync with the checked-in index.js.\n" >&2
echo "⭐️ If the changes below are expected, run 'npm run build:compile && npm run build:package' and commit the output files.\n" >&2
echo "⭐️ If the changes below are expected, run 'npm run build:compile && npm run build:package' and commit the output files." >&2
# Run `git diff` for each line/file in $CHANGED_FILES:
echo "$CHANGED_FILES" | xargs -I {} git diff --ignore-space-at-eol --text -- {}
exit 1
else
echo "✅ No uncommitted changes detected after build."
fi
id: diff