ups/scripts/commit.sh
ngn ab580d6a18
Some checks failed
format / build (push) Failing after 6s
initial commit
Signed-off-by: ngn <ngn@ngn.tf>
2025-05-02 18:20:24 +03:00

24 lines
462 B
Bash

#!/bin/bash
if [ ! -f ups.json ]; then
echo "ups.json not found"
exit 1
fi
git add ups.json
if git diff --exit-code --cached &> /dev/null; then
echo "no updates for ups.json"
exit 1
fi
diff=$(git blame ups.json | grep 'Not Committed Yet' | grep '"commit"')
if [ -z "${diff}" ]; then
echo "no updates for ups.json"
exit 1
fi
commit=$(echo "${diff}" | awk '{print $10}' | sed -e 's/"//g' -e 's/,//g')
git commit -m "ups: update to ${commit:0:7}"