#!/bin/sh
echo "pre-commit: Refreshing packwiz"
cd src
packwiz refresh
echo "pre-commit: Adding changes to git"
git add .
echo "pre-commit: Amending commit with refreshed files"
PREV_COMMIT=$(git log -1 --pretty=%B)
git commit --amend --no-edit --no-verify --reuse-message="$PREV_COMMIT"
echo "pre-commit: Done"
exit 0