Skip to content

Commit

Permalink
Adds idempotent handling
Browse files Browse the repository at this point in the history
  • Loading branch information
WisdomWolf committed Nov 8, 2022
1 parent 009885b commit 120d2e8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
1 change: 0 additions & 1 deletion init-steam-backup-vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export STEAM_BKUPER_REPO="${STEAM_BKUPER_REPO:-'https://github.com/AngeIo/steam-
export STEAM_SAVES_REPO="${STEAM_SAVES_REPO:?}"
export BIN_DIR=$HOME/bin

mkdir -p $STEAM_SAVES_DIR
mkdir -p $BIN_DIR

# Uncomment for debugging
Expand Down
20 changes: 13 additions & 7 deletions steam-backup-setup.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
#!/usr/bin/env bash
set -e
SCRIPT_DIR=$(dirname `readlink -f $0`)
$SCRIPT_DIR/init-steam-backup-vars.sh

mkdir $BIN_DIR
cd $HOME/bin
wget https://github.com/mtkennerly/ludusavi/releases/download/v0.10.0/ludusavi-v0.10.0-linux.zip
unzip ludusavi-v0.10.0-linux.zip
cd $BIN_DIR
wget https://github.com/mtkennerly/ludusavi/releases/download/v0.10.0/ludusavi-v0.10.0-linux.zip -O ludusavi-v0.10.0-linux.zip
unzip -o ludusavi-v0.10.0-linux.zip
rm ludusavi-v0.10.0-linux.zip

git clone $STEAM_BKUPER_REPO $STEAM_BKUPER_DIR
if [ ! -d "$STEAM_BKUPER_DIR" ]; then
git clone $STEAM_BKUPER_REPO $STEAM_BKUPER_DIR
fi

cp $STEAM_BKUPER_DIR/{my-steam-backup.sh,git-sync,init-steam-backup-vars.sh} $BIN_DIR
chmod -R 755 $BIN_DIR
rm -rf $STEAM_BKUPER_DIR
git clone $STEAM_SAVES_REPO $STEAM_SAVES_DIR
# rm -rf $STEAM_BKUPER_DIR

if [ ! -d "$STEAM_SAVES_DIR" ]; then
git clone $STEAM_SAVES_REPO $STEAM_SAVES_DIR
fi

cd $STEAM_SAVES_DIR
if [ -n "$STEAM_SAVES_REPO2" ]; then
git remote add origin-new $STEAM_SAVES_REPO2
Expand Down

0 comments on commit 120d2e8

Please sign in to comment.