aboutsummaryrefslogtreecommitdiff
path: root/patch_iso.sh
diff options
context:
space:
mode:
authorBryson Steck <steck.bryson@gmail.com>2022-06-04 16:57:31 -0600
committerBryson Steck <steck.bryson@gmail.com>2022-06-04 16:57:31 -0600
commitce1aca85b17e23c3be5aa563aac3d3a7fd5d0eb4 (patch)
tree70f3099cb443d1899ef3f04e909bd4428d16243b /patch_iso.sh
parent87b36468dcac3e457f2f77bce3380c7ecddc501b (diff)
downloadriibalanced-patcher-ce1aca85b17e23c3be5aa563aac3d3a7fd5d0eb4.tar
riibalanced-patcher-ce1aca85b17e23c3be5aa563aac3d3a7fd5d0eb4.tar.gz
riibalanced-patcher-ce1aca85b17e23c3be5aa563aac3d3a7fd5d0eb4.tar.bz2
add check if file exists before passing to wit
Diffstat (limited to 'patch_iso.sh')
-rwxr-xr-xpatch_iso.sh11
1 files changed, 9 insertions, 2 deletions
diff --git a/patch_iso.sh b/patch_iso.sh
index b46c9ca..7aff938 100755
--- a/patch_iso.sh
+++ b/patch_iso.sh
@@ -98,7 +98,14 @@ fi
if [[ ! $1 ]]; then
echo "ERROR: Please start this script with the path to the Mario Kart Wii ISO image to start the patch."
echo "example: ./patch_iso.sh image/RMCE01.wbfs"
- exit 0
+ exit 7
+fi
+
+# check if image exists ---------------------------------------------------------
+
+if [[ ! -f "$1" ]]; then
+ echo "ERROR: The file specified does not exist."
+ exit 8
fi
# check for previous image extraction -------------------------------------------
@@ -116,7 +123,7 @@ wit extract $1 RMCE01
ERROR="$?"
if [[ ERROR -ne 0 ]]; then
- echo "ERROR: wit has returned non-zero exit code $ERROR. Please check that your image is in the specified location and the image is authentic and valid."
+ echo "ERROR: wit has returned non-zero exit code $ERROR. Please check that your disc image is authentic and valid."
exit $ERROR
fi