This repository has been archived on 2025-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
GalacticFactory-Legacy/scripts/hooks/post-commit
Seaswimmer 3109451100
All checks were successful
Actions / Build and Upload Export Files (push) Successful in 14s
Actions / Autotagger (push) Successful in 16s
Actions / Build Documentation (push) Successful in 31s
Version bump to 0.9.5
Mods added:
- Better Compatibility Checker
- Default Options
- FramedBlocks

Configs changed:
- `aether-client.toml`
- `aether-common.toml`
- `bcc-common.toml`
- `defaultoptions/keybindings.txt`

KubeJS scripts modified:
- `config/client.properties`
2024-08-03 01:02:10 -04:00

32 lines
1,018 B
Bash
Executable file

#!/bin/sh
project_root=$(git rev-parse --show-toplevel)
cd "$project_root"/src || exit
echo "post-commit: Checking version numbers"
packwiz_version=$(grep '^version =' pack.toml | awk -F'=' '{print $2}' | tr -d '"')
bcc_version=$(grep 'modpackVersion =' config/bcc-common.toml | awk -F'=' '{print $2}' | tr -d '"')
if [ "$packwiz_version" != "$bcc_version" ]; then
echo "post-commit: Version numbers do not match, updating config/bcc-common.toml"
sed -i "s/modpackVersion = .*/modpackVersion = \"$packwiz_version\"/" config/bcc-common.toml
else
echo "post-commit: Version numbers match"
fi
echo "post-commit: Refreshing packwiz"
packwiz refresh
echo "post-commit: Adding changes to git"
git add .
echo "post-commit: Checking for changes"
if git diff-index HEAD --; then
echo "post-commit: No changes detected, exiting"
exit 0
fi
echo "post-commit: Amending commit with refreshed files"
git commit --amend --gpg-sign --no-edit --no-verify --reuse-message=HEAD
echo "post-commit: Done"
exit 0