d2-setup.sh: exit if cd fails

This commit is contained in:
mollusk 2021-09-29 16:57:14 -07:00
parent ccb3595db7
commit 48238e0c69

View File

@ -24,7 +24,7 @@ installD2(){
exit 0;
fi
cd ${D2_INSTALLER_PATH}
cd "${D2_INSTALLER_PATH}" || exit 1
WINEPREFIX="${PREFIX}" WINEARCH="${ARCH}" wine Installer.exe
@ -40,7 +40,7 @@ installLOD(){
exit 0;
fi
cd ${LOD_INSTALLER_PATH}
cd "${LOD_INSTALLER_PATH}" || exit 1
WINEPREFIX="${PREFIX}" WINEARCH="${ARCH}" wine Installer.exe
}
@ -69,20 +69,20 @@ getTricks(){
getGlide(){
if [ ! -f /tmp/gl32ogl14e.zip ];then
cd /tmp
cd /tmp || exit 1
wget http://www.svenswrapper.de/gl32ogl14e.zip
unzip gl32ogl14e.zip
echo -e "\nCopying Files to Diablo game directory...\n"
cp -v {glide-init.exe,glide3x.dll} ${PREFIX}/drive_c/"Program Files"/"Diablo II"/
cp -v {glide-init.exe,glide3x.dll} "${PREFIX}/drive_c/Program Files/Diablo II/"
echo -e "\nCleaning up temp files...\n"
rm {glide-readme.txt,glide-liesmich.txt,glide-init.exe,glide3x.dll,gl32ogl14e.zip}
cd ${PREFIX}/drive_c/"Program Files"/"Diablo II"/
cd "${PREFIX}/drive_c/"Program Files"/"Diablo II"/" || exit 1
WINEPREFIX="${PREFIX}" WINEARCH="${ARCH}" wine glide-init.exe
@ -91,7 +91,7 @@ getGlide(){
}
runGame(){
cd ${PREFIX}/drive_c/"Program Files"/"Diablo II"/
cd "${PREFIX}/drive_c/"Program Files"/"Diablo II"/" || exit 1
echo -n -e "\nRun game now?(Y/n): "
@ -109,7 +109,7 @@ runGame(){
run_glide(){
cd ${PREFIX}/drive_c/"Program Files"/"Diablo II"/
cd "${PREFIX}/drive_c/"Program Files"/"Diablo II"/" || exit 1
WINEPREFIX="${PREFIX}" WINEARCH="${ARCH}" wine "glide-init.exe"