magic alias fix
[feisty_meow.git] / scripts / customize / 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/launch_feisty_meow.sh"
7
8 #we are missing the netcp thing.  why????
9
10 WINE_SOURCE_DIR="$HOME/wine_goods/My Games"
11 SPOOLING_OUTPUT_DIR="$HOME/spooling_saves"
12
13 if [ ! -d "$WINE_SOURCE_DIR" ]; then
14   WINE_SOURCE_DIR="c:/users/fred/My Documents/My Games"
15 fi
16 if [ ! -d "$WINE_SOURCE_DIR" ]; then
17   echo "Failing to find the game save directories."
18   exit 1
19 fi
20
21 # copies the files for a particular game out to a spooling folder.
22 function copyem()
23 {
24   game_name="$1"; shift
25   source_dir="$1"; shift
26   out_dir="$1"; shift
27
28   if [ -d "$source_dir" ]; then
29     echo $game_name
30 #old    cp -v -n "$source_dir"/* "$out_dir"/
31     netcp "$source_dir"/* "$out_dir"/
32     sep 28
33   fi
34 }
35
36 # make the output folders if they don't exist.
37 for i in skyrim fallout_new_vegas fallout_3/Saves oblivion fallout_4/Saves ; do
38   if [ ! -d "$SPOOLING_OUTPUT_DIR/$i" ]; then
39     mkdir -p "$SPOOLING_OUTPUT_DIR/$i"
40   fi
41 done
42
43 # now run through and copy our save files from the potentially weird locations
44 # they reside in.
45
46 sep 28
47
48 copyem "skyrim" "$WINE_SOURCE_DIR/Skyrim/Saves" "$SPOOLING_OUTPUT_DIR/skyrim"
49
50 copyem "fallout new vegas" "$WINE_SOURCE_DIR/FalloutNV/Saves" "$SPOOLING_OUTPUT_DIR/fallout_new_vegas"
51
52 copyem "fallout 3" "$WINE_SOURCE_DIR/Fallout3/Saves" "$SPOOLING_OUTPUT_DIR/fallout_3/Saves"
53
54 copyem "oblivion" "$WINE_SOURCE_DIR/Oblivion/Saves" "$SPOOLING_OUTPUT_DIR/oblivion/"
55
56 copyem "fallout 4" "$WINE_SOURCE_DIR/Fallout4/Saves" "$SPOOLING_OUTPUT_DIR/fallout_4/Saves"
57
58