-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·45 lines (41 loc) · 1.11 KB
/
release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env bash
set -e
version=v$(date '+%Y.%m.%d')
mkdir -p release
for pack in *; do
if [ ! -d "$pack" ]; then
continue
fi
if [ "$pack" = "release" ]; then
continue
fi
if [[ "$pack" == *"(Legacy)" ]]; then
base_pack="${pack% (Legacy)}"
else
base_pack="$pack"
fi
echo Compressing $pack
(
cd "$base_pack"
zip -rq ../release/"$pack $version".zip *
if [[ "$pack" == *"(Legacy)" ]]; then
(
cd ../"$pack"
for fp in $(find . -type f); do
zip -d ../release/"$pack $version".zip $fp
zip -u ../release/"$pack $version".zip $fp
done
)
fi
)
echo Created release/"$pack $version".zip
done
(
cd release
rpdp="Chappeau Resourcepack $version (Datapacks Inside).zip"
echo Creating combo resource / data pack
cp "Chappeau Resourcepack $version.zip" "$rpdp"
zip -uq "$rpdp" "Chappeau Datapack $version.zip"
zip -uq "$rpdp" "Chappeau Datapack (Legacy) $version.zip"
echo Created release/"$rpdp"
)