Tokyo Mirage Sessions #FE:

- allow non-interactive patching using new --xdelta and --cpk params
- properly stop at errors
This commit is contained in:
Christopher Roy Bratusek 2016-07-01 21:58:50 +02:00
parent af834992ba
commit be73dd6596
2 changed files with 28 additions and 17 deletions

View File

@ -538,6 +538,14 @@ while [[ $xcount -lt $pcount ]]; do
PATCHIMAGE_BANNER_DOWNLOAD=TRUE PATCHIMAGE_BANNER_DOWNLOAD=TRUE
;; ;;
--xdelta=* )
XDELTA_PATH=${1/*=}
;;
--cpk=* )
CPK_PATH=${1/*=}
;;
--help | -h ) --help | -h )
echo -e "patchimage ${PATCHIMAGE_VERSION} (${PATCHIMAGE_RELEASE}) echo -e "patchimage ${PATCHIMAGE_VERSION} (${PATCHIMAGE_RELEASE})
@ -556,7 +564,9 @@ while [[ $xcount -lt $pcount ]]; do
--covers | download covers (if available) --covers | download covers (if available)
--only-covers=SMNP02 | download covers only (if available) --only-covers=SMNP02 | download covers only (if available)
--banner=<banner.bnr> | use a custom banner (riivolution games) --banner=<banner.bnr> | use a custom banner (riivolution games)
--download-banner | download a custom banner (if available)" --download-banner | download a custom banner (if available)
--xdelta=<path> | path to xdelta patches
--cpk=<path> | path to unpatched xdelta patches"
exit 0 exit 0
;; ;;
esac esac

View File

@ -20,29 +20,30 @@ Supported Versions: EUR, US
menu () { menu () {
echo -e " echo -e "\nTokyo Mirage Sessions #FE restoration patcher\n"
Tokyo Mirage Sessions #FE restoration patcher
Enter path to the directory containing the delta patches:
"
if [[ ! ${XDELTA_PATH} ]]; then
echo -e "Enter path to the directory containing the delta patches:\n"
read XDELTA_PATH read XDELTA_PATH
fi
echo -e " if [[ ! ${CPK_PATH} ]]; then
Enter path to the directory containing the game files (cpk): echo -e "\nEnter path to the directory containing the game files (cpk):\n"
"
read CPK_PATH read CPK_PATH
fi
if [[ ! -d ${XDELTA_PATH} ]]; then if [[ ! -d ${XDELTA_PATH} ]]; then
echo "PATH \"${XDELTA_PATH}\" does not exist!" || exit 1 echo "PATH \"${XDELTA_PATH}\" does not exist!"
exit 1
elif [[ ! -f ${XDELTA_PATH}/patch_000_map.xdelta ]]; then elif [[ ! -f ${XDELTA_PATH}/patch_000_map.xdelta ]]; then
echo "PATH \"${XDELTA_PATH}\" does not contain the xdelta patches!" || exit 1 echo "PATH \"${XDELTA_PATH}\" does not contain the xdelta patches!"
exit 1
elif [[ ! -d ${CPK_PATH} ]]; then elif [[ ! -d ${CPK_PATH} ]]; then
echo "PATH \"${CPK_PATH}\" does not exist!" || exit 1 echo "PATH \"${CPK_PATH}\" does not exist!"
exit 1
elif [[ ! -f ${CPK_PATH}/pack_000_map.cpk ]]; then elif [[ ! -f ${CPK_PATH}/pack_000_map.cpk ]]; then
echo "PATH \"${CPK_PATH}\" does not contain the game files (cpk)!" || exit 1 echo "PATH \"${CPK_PATH}\" does not contain the game files (cpk)!"
exit 1
fi fi
} }