Less lines, exit on finished installation

This commit is contained in:
Sir RaptaG 2023-06-27 13:53:40 +03:00 committed by GitHub
parent 0006ee3a3d
commit a1843e6565
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -101,12 +101,10 @@ function install_spotube(){
case "${reinstall}" in case "${reinstall}" in
[yY]*) [yY]*)
uninstall_spotube uninstall_spotube ;;
;;
*) *)
echo 'Aborting installation...' echo 'Aborting installation...'
exit 1 exit 1 ;;
;;
esac esac
fi fi
@ -132,12 +130,10 @@ function uninstall_spotube(){
case "${confirm}" in case "${confirm}" in
[yY]*) [yY]*)
echo 'Unstalling Spotube..' echo 'Unstalling Spotube..'
rm -rf ${installDir} ${desktopDir} ${appdata} ${icon} ${symlink} rm -rf ${installDir} ${desktopDir} ${appdata} ${icon} ${symlink} ;;
;;
*) *)
echo 'Aborting...' echo 'Aborting...'
exit 0 exit 0 ;;
;;
esac esac
} }
@ -153,19 +149,16 @@ case "$1" in
install_deps install_deps
download_extract_spotube download_extract_spotube
install_spotube install_spotube
;; exit 0 ;;
-r | --remove) -r | --remove)
rootCheck rootCheck
uninstall_spotube uninstall_spotube
exit 0 exit 0 ;;
;;
-h | --help | "") -h | --help | "")
help help
exit 0 exit 0 ;;
;;
*) *)
echo "Invalid flag "$1"." echo "Invalid flag '$1'"
echo "Please run ./${fname} for more information." echo "Please run ./${fname} for more information."
exit 1 exit 1 ;;
;;
esac esac