Fix paths

This commit is contained in:
the-sane 2020-11-26 08:46:54 -05:00 committed by GitHub
parent 168f9341c6
commit 608d581588
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,14 +37,14 @@ if [ -z "$XDG_CONFIG_HOME" ]; then
else else
conf_dir="$XDG_CONFIG_HOME" conf_dir="$XDG_CONFIG_HOME"
fi fi
conf_subdir="starcitizen-lug" conf_subdir="starcitizen-lug"
# Set some variables needed by the getdirs() function # The game's user subdirectory name
# The user subdirectory name
user_subdir_name="USER" user_subdir_name="USER"
# The location within the USER directory to which the game exports keybinds # The location within the USER directory to which the game exports keybinds
keybinds_export_path="Controls/Mappings" keybinds_export_path="Controls/Mappings"
dxvk_cache_file="StarCitizen.dxvk-cache"
############################################################################ ############################################################################
############################################################################ ############################################################################
@ -271,7 +271,7 @@ getdirs() {
fi fi
if [ -f "$conf_dir/$conf_subdir/$game_conf" ]; then if [ -f "$conf_dir/$conf_subdir/$game_conf" ]; then
game_path="$(cat "$conf_dir/$conf_subdir/$game_conf")" game_path="$(cat "$conf_dir/$conf_subdir/$game_conf")"
if [ ! -d "$game_path" ] || ([ "$(basename "$game_path")" != "Star Citizen" ] && [ "$(basename "$game_path")" != "StarCitizen" ]); then if [ ! -d "$game_path" ] || [ "$(basename "$game_path")" != "StarCitizen" ]; then
echo -e "\nUnexpected game path found in config file, ignoring.\n" echo -e "\nUnexpected game path found in config file, ignoring.\n"
game_path="" game_path=""
fi fi
@ -307,7 +307,7 @@ getdirs() {
if [ "$?" -eq -1 ]; then if [ "$?" -eq -1 ]; then
message warning "An unexpected error has occurred. The helper is unable to proceed." message warning "An unexpected error has occurred. The helper is unable to proceed."
return 1 return 1
elif [ "$(basename "$game_path")" != "Star Citizen" ] && [ "$(basename "$game_path")" != "StarCitizen" ]; then elif [ "$(basename "$game_path")" != "StarCitizen" ]; then
message warning "You must select the directory named 'StarCitizen'" message warning "You must select the directory named 'StarCitizen'"
else else
# All good or cancel # All good or cancel
@ -363,7 +363,7 @@ getdirs() {
while read -rp ": " game_path; do while read -rp ": " game_path; do
if [ ! -d "$game_path" ]; then if [ ! -d "$game_path" ]; then
echo -e "That directory is invalid or does not exist. Please try again.\n" echo -e "That directory is invalid or does not exist. Please try again.\n"
elif [ "$(basename "$game_path")" != "Star Citizen" ] && [ "$(basename "$game_path")" != "StarCitizen" ]; then elif [ "$(basename "$game_path")" != "StarCitizen" ]; then
echo -e "You must enter the full path to the directory named 'StarCitizen'\n" echo -e "You must enter the full path to the directory named 'StarCitizen'\n"
else else
break break
@ -605,7 +605,7 @@ rm_vidcache() {
return 0 return 0
fi fi
dxvk_cache="$game_path/$live_or_ptu/StarCitizen-dxvk.cache" dxvk_cache="$game_path/$live_or_ptu/$dxvk_cache_file"
# Sanity check # Sanity check
if [ ! -f "$dxvk_cache" ]; then if [ ! -f "$dxvk_cache" ]; then