From 5c8b59db19c6ce0167462dcfe9699faa05d9ce21 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Sat, 14 Jan 2017 20:30:09 +0100 Subject: [PATCH] Checks done differently --- lgsm/functions/command_mods_install.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lgsm/functions/command_mods_install.sh b/lgsm/functions/command_mods_install.sh index a2c7b8bed..c1bbcf89c 100644 --- a/lgsm/functions/command_mods_install.sh +++ b/lgsm/functions/command_mods_install.sh @@ -43,6 +43,19 @@ fn_mods_install_init(){ fn_script_log "Installing ${modprettyname}." } +fn_mods_requirements(){ + # If systemdir doesn't exist, then the game isn't installed + if [ ! -d "${systemdir}" ]; then + fn_print_fail "${gamename} needs to be installed first." + core_exit.sh + # If tompdir variable doesn't exist, LGSM is too old + elif [ -z "${tmpdir}" ]||[ -z "${lgsmdir}" ]; then + fn_print_fail "Your LGSM version is too old." + echo " * Please do a full update, including ${selfname} script." + core_exit.sh + fi +} + # Create mods directory if it doesn't exist # Assuming the game is already installed as mods_list.sh checked for it. fn_mods_dir(){ @@ -170,6 +183,6 @@ fn_mod_installation(){ fi } -fn_mods_install_checks +fn_mods_requirements fn_mods_install_init fn_mod_installation