enhancement--not complaining about empty save dirs
[feisty_meow.git] / scripts / customize / fred / scripts / games / gamesaver.sh
index 02401f1372e050cda679208d250beb06def2a434..9a8399d3ee1c0808a1693cc9acf22d08e49c8da1 100644 (file)
@@ -30,7 +30,7 @@ function copyem()
   source_dir="$1"; shift
   out_dir="$1"; shift
 
-  if [ -d "$source_dir" ]; then
+  if [ -d "$source_dir" -a $(ls "$source_dir" 2>/dev/null | wc -c) != 0 ]; then
     echo $game_name
     if [ ! -d "$out_dir" ]; then
       mkdir -p "$out_dir"
@@ -41,13 +41,7 @@ function copyem()
   fi
 }
 
-#### make the output folders if they don't exist.
-####hmmm: do we really need to do this?
-###for i in skyrim fallout_new_vegas fallout_3 oblivion fallout_4 witcher_3 ; do
-###  if [ ! -d "$SPOOLING_OUTPUT_DIR/$i" ]; then
-###    mkdir -p "$SPOOLING_OUTPUT_DIR/$i"
-###  fi
-###done
+##############
 
 # now run through and copy our save files from the potentially weird locations
 # they reside in.
@@ -64,6 +58,6 @@ copyem "oblivion" "$WINE_GAMES_DIR/Oblivion/Saves" "$SPOOLING_OUTPUT_DIR/oblivio
 
 copyem "fallout 4" "$WINE_GAMES_DIR/Fallout4/Saves" "$SPOOLING_OUTPUT_DIR/fallout_4"
 
-copyem "witcher 3" "$WINE_GOODS_DIR/The*Witcher*3/gamesaves" "$SPOOLING_OUTPUT_DIR/witcher_3"
+copyem "witcher 3" "$WINE_GOODS_DIR/The Witcher 3/gamesaves" "$SPOOLING_OUTPUT_DIR/witcher_3"