updated to use vars for the paths and added comments.
authorChris Koeritz <fred@gruntose.com>
Wed, 20 Jul 2016 12:51:30 +0000 (08:51 -0400)
committerChris Koeritz <fred@gruntose.com>
Wed, 20 Jul 2016 12:51:30 +0000 (08:51 -0400)
customizing/fred/scripts/gamesaver.sh

index def0d89ac07b44b8bc1f96bc426b2540523fb033..1e9c5295ec47d3dd5b18a9f347bf029691df2b08 100644 (file)
@@ -1,20 +1,36 @@
+#!/bin/bash
 
-# hmmm: some better work could be done to have both names (wineprefix and storage dir) be iterable.
+# a helpful script that scrapes any active game saves from wine's storage
+# area into a spooling saves folder for archiving.
+
+WINE_SOURCE_DIR="$HOME/wine_goods/My Games"
+SPOOLING_OUTPUT_DIR="$HOME/spooling_saves"
+
+function line()
+{
+  echo "======="
+}
+
+# make the output folders if they don't exist.
 for i in oblivion fallout_new_vegas fallout_3 skyrim ; do
-  if [ ! -d $HOME/spooling_saves/$i ]; then
-    mkdir -p $HOME/spooling_saves/$i 
+  if [ ! -d "$SPOOLING_OUTPUT_DIR/$i" ]; then
+    mkdir -p "$SPOOLING_OUTPUT_DIR/$i"
   fi
 done
-echo "======="
+
+# now run through and copy our save files from the potentially weird
+# locations they reside in.
+line
 echo skyrim
-cp -v -n ~/wine_goods/My\ Games/Skyrim/Saves/* ~/spooling_saves/skyrim/
-echo "======="
+cp -v -n "$WINE_SOURCE_DIR/Skyrim/Saves"/* "$SPOOLING_OUTPUT_DIR/skyrim/"
+line
 echo fallout new vegas
-cp -v -n ~/wine_goods/My\ Games/FalloutNV/Saves/* ~/spooling_saves/fallout_new_vegas/
-echo "======="
+cp -v -n "$WINE_SOURCE_DIR/FalloutNV/Saves"/* "$SPOOLING_OUTPUT_DIR/fallout_new_vegas/"
+line
 echo fallout 3
-cp -v -n ~/wine_goods/My\ Games/Fallout3/Saves/Player1/* ~/spooling_saves/fallout_3/
-echo "======="
+cp -v -n "$WINE_SOURCE_DIR/Fallout3/Saves/Player1"/* "$SPOOLING_OUTPUT_DIR/fallout_3/"
+line
 echo oblivion
-cp -v -n ~/wine_goods/My\ Games/Oblivion/Saves/* ~/spooling_saves/oblivion/
-echo "======="
+cp -v -n "$WINE_SOURCE_DIR/Oblivion/Saves"/* "$SPOOLING_OUTPUT_DIR/oblivion/"
+line
+