fixing reconfig process
[feisty_meow.git] / scripts / customize / fred / scripts / games / fallout_new_vegas_link_fixer.sh
1 #!/bin/bash
2
3 # sets up links to make fallout new vegas work properly under wine.
4 # some mods will look for paths that are incorrectly case sensitive, and this
5 # script just sets up all those links that we believe are required.
6
7 source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
8
9 if [ ! -d Data ]; then
10   echo '
11 This script needs to run from the "Fallout New Vegas" install directory,
12 which is usually found under "steam/steamapps/common".
13 '
14   exit 1
15 fi
16
17 function make_local_dir_link()
18 {
19   dir="$1"; shift
20   name="$1"; shift
21   new_name="$1"; shift
22   pushd "$dir" &>/dev/null
23   if [ -L "$new_name" ]; then
24     echo "Skipping creation of existing link $dir/$new_name"
25     popd &>/dev/null
26     return
27   fi
28   if [ ! -d "$name" ]; then
29     echo "Skipping creation of link $dir/$new_name due to missing directory $dir/$name"
30     popd &>/dev/null
31     return
32   fi
33   ln -s "$name" "$new_name"
34   test_or_die "creating link for $dir/$new_name from $dir/$name"
35   echo "Created link $dir/$new_name from $dir/$name"
36   popd &>/dev/null
37 }
38
39 make_local_dir_link Data Sound sound
40 make_local_dir_link Data Textures textures
41 make_local_dir_link Data Meshes meshes
42 make_local_dir_link Data/Meshes Landscape landscape
43 make_local_dir_link Data/Meshes Weapons weapons
44 make_local_dir_link Data/Sound Voice voice
45 make_local_dir_link Data/Textures Landscape landscape
46 make_local_dir_link Data/Textures Landscape weapons
47 make_local_dir_link Data/Textures Landscape clutter
48