diff options
| author | Kyren223 <ulmliad223@gmail.com> | 2024-10-14 19:22:44 +0300 |
|---|---|---|
| committer | Kyren223 <ulmliad223@gmail.com> | 2024-10-14 19:22:44 +0300 |
| commit | b465d39dedd0fd97f1de21631155d4d49317650c (patch) | |
| tree | 8a545ff13bd24925e80495a81c28f567000fc154 | |
| parent | 51e88b11e5b0e917a1bdcb7e7454ee2442974ae0 (diff) | |
feat: added build automation script from Kapi
| -rwxr-xr-x | scripts/zip.sh | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/scripts/zip.sh b/scripts/zip.sh new file mode 100755 index 0000000..f5a6e28 --- /dev/null +++ b/scripts/zip.sh @@ -0,0 +1,38 @@ +#!/bin/zsh + +if [ "$#" -ne 1 ]; then + echo "Usage: $0 <version>" + exit 1 +fi + +GROUP="io/github/kapimc" +PROJECT="kapi" +VERSION="$1" + +M2_REPO="/mnt/c/Users/Owner/.m2/repository" +SONATYPE=".sonatype" + +mkdir -p "$SONATYPE" + +mkdir -p "tmp/$GROUP/$PROJECT" +cp -r "$M2_REPO/$GROUP/$PROJECT/$VERSION" "tmp/$GROUP/$PROJECT" +if [ "$?" -ne 0 ]; then + echo "Error: failed to copy files from $M2_REPO/$GROUP/$PROJECT/$VERSION to tmp/$GROUP/$PROJECT" + exit 1 +fi + +cd tmp +zip -r "../$SONATYPE/$PROJECT-$VERSION.zip" . +if [ "$?" -ne 0 ]; then + echo "Error: failed to create ZIP file at $SONATYPE/$PROJECT-$VERSION.zip" + exit 1 +fi +cd .. + +rm -rf "tmp" +if [ "$?" -ne 0 ]; then + echo "Error: failed to delete tmp directory" + exit 1 +fi + +echo "Successfully created ZIP file at $SONATYPE/$PROJECT-$VERSION.zip" |
