24 lines
469 B
Bash
Executable File
24 lines
469 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -exou pipefail
|
|
|
|
# Make sure our tmp directory exists
|
|
mkdir -p /tmp/strangerbot
|
|
|
|
TEMP_DIR=$(mktemp -d "repo-updater.XXXX" -p $XDG_RUNTIME_DIR)
|
|
pushd $TEMP_DIR
|
|
|
|
if git clone "$1" repo && pushd repo && git switch $2 && ./update.sh; then
|
|
git add -A
|
|
if git commit -S -m "Update flake/dependencies"; then
|
|
git push -u origin $2
|
|
else
|
|
echo "No changes made"
|
|
fi
|
|
else
|
|
echo "Update failed"
|
|
fi
|
|
|
|
popd
|
|
popd
|
|
rm -rf $TEMP_DIR
|