Add confirmation to git commit and push

This commit is contained in:
Dave Gallant
2025-02-25 22:26:21 -05:00
parent 18e03a9393
commit 4287450229

View File

@@ -6,6 +6,12 @@ git pull
update_msg=$(nix flake update 2>&1 | grep -v 'warning:')
just rebuild
git add .
read -p "Commit and push changes? [yN]? " -r
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
exit 1
fi
git commit -S -m "nix flake update: $(TZ=UTC date '+%Y-%m-%d %H:%M:%S %Z')
$update_msg"