fixed usage of extra line printing method to use sep.
[feisty_meow.git] / customizing / fred / scripts / gamesaver.sh
1 #!/bin/bash
2
3 # a helpful script that scrapes any active game saves from wine's storage
4 # area into a spooling saves folder for archiving.
5
6 source $FEISTY_MEOW_SCRIPTS/core/functions.sh
7
8 WINE_SOURCE_DIR="$HOME/wine_goods/My Games"
9 SPOOLING_OUTPUT_DIR="$HOME/spooling_saves"
10
11 # copies the files for a particular game out to a spooling folder.
12 function copyem()
13 {
14   game_name="$1"; shift
15   source_dir="$1"; shift
16   out_dir="$1"; shift
17
18   if [ -d "$source_dir" ]; then
19     echo $game_name
20     cp -v -n "$source_dir"/* "$out_dir"/
21     sep 28
22   fi
23 }
24
25 # make the output folders if they don't exist.
26 for i in skyrim fallout_new_vegas fallout_3 oblivion fallout4 ; do
27   if [ ! -d "$SPOOLING_OUTPUT_DIR/$i" ]; then
28     mkdir -p "$SPOOLING_OUTPUT_DIR/$i"
29   fi
30 done
31
32 # now run through and copy our save files from the potentially weird locations
33 # they reside in.
34
35 #hmmm: at least make a function out of those repetitive steps.  sheesh.
36
37 sep 28
38
39 copyem "skyrim" "$WINE_SOURCE_DIR/Skyrim/Saves" "$SPOOLING_OUTPUT_DIR/skyrim"
40
41 copyem "fallout new vegas" "$WINE_SOURCE_DIR/FalloutNV/Saves" "$SPOOLING_OUTPUT_DIR/fallout_new_vegas"
42
43 copyem "fallout 3" "$WINE_SOURCE_DIR/Fallout3/Saves/Player1" "$SPOOLING_OUTPUT_DIR/fallout_3"
44
45 copyem "oblivion" "$WINE_SOURCE_DIR/Oblivion/Saves" "$SPOOLING_OUTPUT_DIR/oblivion/"
46
47 copyem "fallout 4" "$WINE_SOURCE_DIR/Fallout4/Saves" "$SPOOLING_OUTPUT_DIR/fallout4"
48
49