23 lines
328 B
Bash
23 lines
328 B
Bash
|
#!/usr/bin/env bash
|
||
|
set -eou pipefail
|
||
|
|
||
|
TEMP_DIR=$(mktemp -d "repo-updater.XXXX" -p $XDG_RUNTIME_DIR)
|
||
|
pushd $TEMP_DIR
|
||
|
|
||
|
git clone "$1" repo
|
||
|
pushd repo
|
||
|
git switch $2
|
||
|
|
||
|
./update.sh
|
||
|
|
||
|
git add -A
|
||
|
if git commit -m "Update flake/dependencies"; then
|
||
|
git push -u origin $2
|
||
|
else
|
||
|
echo "No changes made"
|
||
|
fi
|
||
|
|
||
|
popd
|
||
|
popd
|
||
|
rm -rf $TEMP_DIR
|