🚀 install script for v1.0.3

This commit is contained in:
ful1e5 2020-08-30 17:21:06 +05:30
parent 5c87d9b5ff
commit aab095b45f

View file

@ -5,9 +5,9 @@ INPUT=$1
ROOT_UID=0 ROOT_UID=0
DEST_DIR= DEST_DIR=
URL="https://github.com/ful1e5/apple_cursor/releases/download/1.0.2/macOSBigSur.tar" URL="https://github.com/ful1e5/apple_cursor/releases/download/1.0.3/macOSBigSur.tar.gz"
macOSBigSur="./macOSBigSur" macOSBigSur="./macOSBigSur"
DOWNLOAD_FILE_NAME="$macOSBigSur.tar" DOWNLOAD_FILE_NAME="$macOSBigSur.tar.gz"
cd "$( dirname "${BASH_SOURCE[0]}" )" || exitt cd "$( dirname "${BASH_SOURCE[0]}" )" || exitt
@ -45,13 +45,13 @@ end() {
# -------------------- Helpers -------------------- # -------------------- Helpers --------------------
continue() { continue() {
case ${INPUT} in case ${INPUT} in
'-a' ) ( '-a' )
: :
;; ;;
'-h' ) ( '-h' )
echo " -a - Auto-install for all users!" echo " -a - Auto-install for all users!"
;; ;;
* ) ( * )
show_question "\nDo you want to continue? (Y)es, (N)o : \n" show_question "\nDo you want to continue? (Y)es, (N)o : \n"
read INPUT read INPUT
case $INPUT in case $INPUT in
@ -101,13 +101,11 @@ function download {
function unpack { function unpack {
echo -e "\nUnpacking Theme..." echo -e "\nUnpacking Theme..."
file=$1 file=$1
dir=${file%.*}
echo "$dir" # extract .tar.gz file content to it
# creating dir and extract .tar file content to it tar -xvf "$file"
mkdir "$dir" && tar -xvf "$file" -C "$dir"
# remove .tar file # remove .tar.gz file
rm -rf $file rm -rf $file
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
@ -121,7 +119,7 @@ install() {
# Cecking old version exits or not # Cecking old version exits or not
if [ -f "$DOWNLOAD_FILE_NAME" ] || [ -f "$macOSBigSur" ]; then if [ -f "$DOWNLOAD_FILE_NAME" ] || [ -f "$macOSBigSur" ]; then
echo -e "\nmacOSBigSur.tar file already exists" echo -e "\nmacOSBigSur.tar.gz file already exists"
show_question "\nDownload Fresh Theme OR Continue with existing file? (D)ownload File (recommended), (E)xisting File : \n " show_question "\nDownload Fresh Theme OR Continue with existing file? (D)ownload File (recommended), (E)xisting File : \n "
read INPUT read INPUT
case $INPUT in case $INPUT in
@ -198,13 +196,13 @@ remove() {
main() { main() {
# Cases # Cases
case ${INPUT} in case ${INPUT} in
'-a' ) ( '-a' )
install install
;; ;;
'-h' ) ( '-h' )
echo " -a - Auto-install for all users!" echo " -a - Auto-install for all users!"
;; ;;
* ) ( * )
show_question "What you want to do: (I)nstall, (R)emove : \n" show_question "What you want to do: (I)nstall, (R)emove : \n"
read INPUT read INPUT
case $INPUT in case $INPUT in