47 lines
1.4 KiB
Bash
Executable file
47 lines
1.4 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
# Main modpack project directory
|
|
cd "$(dirname "$0")"
|
|
basedir="$PWD"
|
|
|
|
# Location for downloading/updating the mc_rebalance mod
|
|
if [ ! -d deps ]; then
|
|
mkdir deps
|
|
fi;
|
|
|
|
# Location for saving the mc_rebalance mod
|
|
if [ ! -d overrides/mods ]; then
|
|
mkdir -p overrides/mods
|
|
fi;
|
|
|
|
# If the user provides input e.g. `./export-pack.sh 1`, clone the repository using https
|
|
if [ -n "$1" ]; then
|
|
repo_prefix="https://patience.nearmisses.xyz/"
|
|
else
|
|
repo_prefix="forgejo@patience.nearmisses.xyz:"
|
|
fi
|
|
|
|
mod_repo="$repo_prefix/patience/mc_rebalance.git"
|
|
|
|
# Clone the repos if they don't exist, otherwise, update them
|
|
git clone "$mod_repo" "$basedir/deps/mc_rebalance" --branch 1.21 || (cd "$basedir/deps/mc_rebalance"; git checkout 1.21; git pull) || exit 1
|
|
|
|
rm "$basedir/deps/mc_rebalance/build/libs/mc_rebalance-"*".jar"
|
|
(cd "$basedir"/deps/mc_rebalance/ && ./gradlew build)
|
|
|
|
(cd "$basedir/overrides/global_packs/mc_rebalance_datapack/assets/minecraft/lang/" && ./gen-langs.sh)
|
|
|
|
rm "$basedir/overrides/mods/mc_rebalance-"*".jar"
|
|
cp "$(find $basedir/deps/mc_rebalance/build/libs -regex "$basedir/deps\/mc_rebalance\/build\/libs\/mc_rebalance-[0-9\.]+\.jar")" "$basedir/overrides/mods"
|
|
|
|
# Final path for the modpack
|
|
if [ ! -d release ]; then
|
|
mkdir release
|
|
fi;
|
|
|
|
# Get version from the mrpack file
|
|
version="$(jq -r ".versionId" modrinth.index.json)"
|
|
|
|
# Export release to file
|
|
zip -FSr "$basedir/release/MC_Rebalance_${version}.mrpack" overrides modrinth.index.json -x "*.git*"
|