From 16378b9172008e98a43b17ab51ba97aa4af7713b Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Fri, 1 Jul 2016 22:00:58 +0200 Subject: [PATCH] Tokyo Mirage Sessions #FE: proper exit codes --- README.EXIT_CODES | 2 +- script.d/tokyomiragesessionsfe.sh | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.EXIT_CODES b/README.EXIT_CODES index 9d3365e..40cd27b 100644 --- a/README.EXIT_CODES +++ b/README.EXIT_CODES @@ -13,7 +13,7 @@ right after the failure will you show the following: 33 custom banner specified from command line is not a .bnr file 39 custom game id specified from command line is not a 6 digit alphanumeric 45 error copying new game files - 51 wit/ips/applyppf/szs caught an error processing files + 51 wit/ips/applyppf/szs/xdelta3 caught an error processing files 57 wget caught an error while downloading 63 unp caught an error while unpacking a file 69 wiimmfi caught an error patching the image diff --git a/script.d/tokyomiragesessionsfe.sh b/script.d/tokyomiragesessionsfe.sh index 5a68fb8..8bf0a31 100644 --- a/script.d/tokyomiragesessionsfe.sh +++ b/script.d/tokyomiragesessionsfe.sh @@ -24,26 +24,26 @@ menu () { if [[ ! ${XDELTA_PATH} ]]; then echo -e "Enter path to the directory containing the delta patches:\n" - read XDELTA_PATH + read XDELTA_PATH || exit 75 fi if [[ ! ${CPK_PATH} ]]; then echo -e "\nEnter path to the directory containing the game files (cpk):\n" - read CPK_PATH + read CPK_PATH || exit 75 fi if [[ ! -d ${XDELTA_PATH} ]]; then echo "PATH \"${XDELTA_PATH}\" does not exist!" - exit 1 + exit 21 elif [[ ! -f ${XDELTA_PATH}/patch_000_map.xdelta ]]; then echo "PATH \"${XDELTA_PATH}\" does not contain the xdelta patches!" - exit 1 + exit 21 elif [[ ! -d ${CPK_PATH} ]]; then echo "PATH \"${CPK_PATH}\" does not exist!" - exit 1 + exit 15 elif [[ ! -f ${CPK_PATH}/pack_000_map.cpk ]]; then echo "PATH \"${CPK_PATH}\" does not contain the game files (cpk)!" - exit 1 + exit 15 fi } @@ -55,7 +55,7 @@ patch () { echo ">> pack_${patch}.cpk" ${XD3} -d -f -s ${CPK_PATH}/pack_${patch}.cpk \ ${XDELTA_PATH}/patch_${patch}.xdelta \ - ${CPK_PATH}/pack_${patch}.cpk_new || exit 1 + ${CPK_PATH}/pack_${patch}.cpk_new || exit 51 mv ${CPK_PATH}/pack_${patch}.cpk_new \ ${CPK_PATH}/pack_${patch}.cpk