From 67e6b9504322501aa25ed28e8066208736d90d63 Mon Sep 17 00:00:00 2001 From: endernon Date: Tue, 12 Nov 2024 19:21:56 +0000 Subject: [PATCH] polish build script --- .gitignore | 1 + build.sh | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100755 build.sh diff --git a/.gitignore b/.gitignore index 378eac2..ea5b07b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ build +build.zip diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..0201bd7 --- /dev/null +++ b/build.sh @@ -0,0 +1,22 @@ +# create the build dir if it doesn't already exist +mkdir -p ./build + +# move all necessary files to the build dir +cp -r {assets,pack.png,pack.mcmeta} ./build + +# change working dir into the build dir +cd build + +# remove all the gimp files (those don't do anything in the final build) +find . -name "*.xcf" -type f -delete + +# zip all files in build dir recursively, into build.zip in base folder. use -0 flag to disable compression. +zip -r ../build.zip . -0 + +# change back to root dir +cd .. + +# nuke the build dir +rm -r build + +echo "file built to build.zip"