Skip to content

Commit

Permalink
Update pack.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
krypciak committed May 1, 2024
1 parent 2a928bc commit 887b4d0
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions pack.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
#!/bin/sh
set -e
BASE_NAME="$(jq '.id' ccmod.json | sed 's/^"//;s/"$//')"
NAME="${BASE_NAME}-$(jq '.version' ccmod.json | sed 's/^"//;s/"$//').ccmod"
rm -rf "$BASE_NAME"*
pnpm install
pnpm run build
zip -r "$NAME" ./ -x "*.ccmod" "*.zip" "node_modules/*" ".git*" "*.ts" "*.md" \
"tsconfig.json" "*.sh" "package-lock.json" "pack/*" "bundle.zip" ".prettierrc.json" \
"*.kra" "*.kra~" "*.png~" "src/*"
mkdir -p pack
cp -rf icon LICENSE plugin.js ./pack
[ -d ./assets ] && cp -r assets ./pack
[ -d ./lang ] && cp -r lang ./pack

cd ./pack
for file in $(find . -iname '*.json') $(find . -iname '*.json.patch') $(find . -iname '*.json.patch.cond'); do
jq '.' ../$file -c > $file
done
cp ../ccmod.json .
rm -rf icon/icon240.png
LIST="$(find . -name '*.kra') $(find . -name '*~')"
rm -rf $LIST
zip -r "../$NAME" .
cd ..
rm -rf pack

0 comments on commit 887b4d0

Please sign in to comment.