Skip to content

Commit

Permalink
build(scripts): update bundle.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
remarkablemark committed Feb 27, 2024
1 parent 21db692 commit 3982b32
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions scripts/bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
BUNDLE=true npm run build

# replace absolute URLs with relative URLs
if [ "$(uname)" == 'Darwin' ]; then
if [[ $(uname) == 'Darwin' ]]; then
sed -i '' -e 's|src="/|src="|g' -e 's|href="/|href="|g' dist/index.html
else
sed -i -e 's|src="/|src="|g' -e 's|href="/|href="|g' dist/index.html
fi

# zip file
zip -r "dist/$(npm pkg get name | tr -d \")-$(npm pkg get version | tr -d \").zip" dist
echo
find dist -type f -depth 1 -name '*.zip'
open dist
if [[ $CI != 'true' ]]; then
zip -r "dist/$(npm pkg get name | tr -d \")-$(npm pkg get version | tr -d \").zip" dist
echo
find dist -type f -depth 1 -name '*.zip'
open dist
fi

0 comments on commit 3982b32

Please sign in to comment.