diff --git a/patchimage.sh b/patchimage.sh index cc25e68..ce189db 100755 --- a/patchimage.sh +++ b/patchimage.sh @@ -6,24 +6,16 @@ # # License: GPL v3 -if [[ ! -d ${PWD}/workdir ]]; then - mkdir ${PWD}/workdir -else - rm -rf ${PWD}/workdir/* -fi - if [[ -d ${PWD}/script.d ]]; then - PATCHIMAGE_SCRIPT_DIR=../script.d - PATCHIMAGE_PATCH_DIR=../patches - PATCHIMAGE_TOOLS_DIR=../tools + PATCHIMAGE_SCRIPT_DIR=${PWD}/script.d + PATCHIMAGE_PATCH_DIR=${PWD}/patches + PATCHIMAGE_TOOLS_DIR=${PWD}/tools else PATCHIMAGE_SCRIPT_DIR=/usr/share/patchimage/script.d PATCHIMAGE_PATCH_DIR=/usr/share/patchimage/patches PATCHIMAGE_TOOLS_DIR=/usr/share/patchimage/tools fi -cd ${PWD}/workdir - PATCHIMAGE_RIIVOLUTION_DIR=${PWD} PATCHIMAGE_WBFS_DIR=${PWD} PATCHIMAGE_AUDIO_DIR=${PWD} @@ -174,7 +166,7 @@ case ${GAME_TYPE} in echo "*** 12) remove workdir" cd .. - rm -rf workdir + rm -rf ${WORKDIR} echo -e "\n >>> ${GAMENAME} saved as: ${PATCHIMAGE_WBFS_DIR}/${GAMEID}.wbfs\n" diff --git a/script.d/common.sh b/script.d/common.sh index 26cb231..62863d0 100644 --- a/script.d/common.sh +++ b/script.d/common.sh @@ -160,12 +160,12 @@ check_input_image () { x=0 if [[ ! ${IMAGE} ]]; then - if [[ -f BASE.wbfs ]]; then + if [[ *.wbfs ]]; then x=1 - IMAGE=BASE.wbfs - elif [[ -f BASE.iso ]]; then + IMAGE=*.wbfs + elif [[ *.iso ]]; then x=1 - IMAGE=BASE.iso + IMAGE=*.iso fi fi echo "*** >> status: ${x}" @@ -250,7 +250,7 @@ ask_input_image_wiimmfi () { echo "Choose Wii Game Image to wiimmfi" - for image in ${1}/??????.{iso,wbfs}; do + for image in ${1}/*.{iso,wbfs}; do if [[ -e ${image} && ! ${image} == "*/RMC*" ]]; then echo " ${image##*/}" fi