Skip to content

Commit

Permalink
Added file comparison to detect changes in jsDelivr URL update routine
Browse files Browse the repository at this point in the history
... for proper status echo ↞ [auto-sync from `generate-ip/utils`]
  • Loading branch information
adamlui authored and kudo-sync-bot committed May 5, 2024
1 parent 2f53cb0 commit 45ae629
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 5 deletions.
5 changes: 4 additions & 1 deletion generate-pw/utils/bump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ bash utils/build.sh
# Update jsDelivr URLs for GitHub assets w/ commit hash
echo -e "${by}\nUpdating jsDelivr URLs for GitHub assets w/ commit hash...${nc}"
BUMP_HASH=$(git rev-parse HEAD)
if sed -i -E "s|(cdn\.jsdelivr\.net\/gh\/[^/]+\/[^@/]+)[^/]*|\1@$BUMP_HASH|g" dist/cli.min.js
OLD_FILE=$(<dist/cli.min.js)
sed -i -E "s|(cdn\.jsdelivr\.net\/gh\/[^/]+\/[^@/]+)[^/]*|\1@$BUMP_HASH|g" dist/cli.min.js
NEW_FILE=$(<dist/cli.min.js)
if [[ "$OLD_FILE" != "$NEW_FILE" ]]
then echo -e "${bw}$BUMP_HASH${nc}"
else echo "No jsDelivr URLs for GH assets found in built files"
fi
Expand Down
5 changes: 4 additions & 1 deletion geolocate/utils/bump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ bash utils/build.sh
# Update jsDelivr URLs for GitHub assets w/ commit hash
echo -e "${by}\nUpdating jsDelivr URLs for GitHub assets w/ commit hash...${nc}"
BUMP_HASH=$(git rev-parse HEAD)
if sed -i -E "s|(cdn\.jsdelivr\.net\/gh\/[^/]+\/[^@/]+)[^/]*|\1@$BUMP_HASH|g" dist/cli.min.js
OLD_FILE=$(<dist/cli.min.js)
sed -i -E "s|(cdn\.jsdelivr\.net\/gh\/[^/]+\/[^@/]+)[^/]*|\1@$BUMP_HASH|g" dist/cli.min.js
NEW_FILE=$(<dist/cli.min.js)
if [[ "$OLD_FILE" != "$NEW_FILE" ]]
then echo -e "${bw}$BUMP_HASH${nc}"
else echo "No jsDelivr URLs for GH assets found in built files"
fi
Expand Down
5 changes: 4 additions & 1 deletion minify.js/gulp/utils/bump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ bash utils/build.sh
# Update jsDelivr URLs for GitHub assets w/ commit hash
echo -e "${by}\nUpdating jsDelivr URLs for GitHub assets w/ commit hash...${nc}"
BUMP_HASH=$(git rev-parse HEAD)
if sed -i -E "s|(cdn\.jsdelivr\.net\/gh\/[^/]+\/[^@/]+)[^/]*|\1@$BUMP_HASH|g" dist/cli.min.js
OLD_FILE=$(<dist/cli.min.js)
sed -i -E "s|(cdn\.jsdelivr\.net\/gh\/[^/]+\/[^@/]+)[^/]*|\1@$BUMP_HASH|g" dist/cli.min.js
NEW_FILE=$(<dist/cli.min.js)
if [[ "$OLD_FILE" != "$NEW_FILE" ]]
then echo -e "${bw}$BUMP_HASH${nc}"
else echo "No jsDelivr URLs for GH assets found in built files"
fi
Expand Down
5 changes: 4 additions & 1 deletion minify.js/node.js/utils/bump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ bash utils/build.sh
# Update jsDelivr URLs for GitHub assets w/ commit hash
echo -e "${by}\nUpdating jsDelivr URLs for GitHub assets w/ commit hash...${nc}"
BUMP_HASH=$(git rev-parse HEAD)
if sed -i -E "s|(cdn\.jsdelivr\.net\/gh\/[^/]+\/[^@/]+)[^/]*|\1@$BUMP_HASH|g" dist/cli.min.js
OLD_FILE=$(<dist/cli.min.js)
sed -i -E "s|(cdn\.jsdelivr\.net\/gh\/[^/]+\/[^@/]+)[^/]*|\1@$BUMP_HASH|g" dist/cli.min.js
NEW_FILE=$(<dist/cli.min.js)
if [[ "$OLD_FILE" != "$NEW_FILE" ]]
then echo -e "${bw}$BUMP_HASH${nc}"
else echo "No jsDelivr URLs for GH assets found in built files"
fi
Expand Down
5 changes: 4 additions & 1 deletion scss-to-css/node.js/utils/bump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ bash utils/build.sh
# Update jsDelivr URLs for GitHub assets w/ commit hash
echo -e "${by}\nUpdating jsDelivr URLs for GitHub assets w/ commit hash...${nc}"
BUMP_HASH=$(git rev-parse HEAD)
if sed -i -E "s|(cdn\.jsdelivr\.net\/gh\/[^/]+\/[^@/]+)[^/]*|\1@$BUMP_HASH|g" dist/cli.min.js
OLD_FILE=$(<dist/cli.min.js)
sed -i -E "s|(cdn\.jsdelivr\.net\/gh\/[^/]+\/[^@/]+)[^/]*|\1@$BUMP_HASH|g" dist/cli.min.js
NEW_FILE=$(<dist/cli.min.js)
if [[ "$OLD_FILE" != "$NEW_FILE" ]]
then echo -e "${bw}$BUMP_HASH${nc}"
else echo "No jsDelivr URLs for GH assets found in built files"
fi
Expand Down

0 comments on commit 45ae629

Please sign in to comment.