From 53b5037792b96b2902978945aefac23f3c39c36d Mon Sep 17 00:00:00 2001 From: Sannidhya <58990408+sannidhyaroy@users.noreply.github.com> Date: Sun, 16 Feb 2025 15:12:56 +0530 Subject: [PATCH] `fix`: remove old files on successful download --- install.sh | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/install.sh b/install.sh index 96a1378..7e07466 100644 --- a/install.sh +++ b/install.sh @@ -20,6 +20,20 @@ echo "Welcome to Zen tarball installer, just chill and wait for the installation sleep 1 +echo "Downloading the latest package" +curl -L -o $tar_location $official_package_location +if [ $? -eq 0 ]; then + echo OK +else + echo "Download failed. Curl not found or not installed" + exit +fi + +echo "Extracting Zen Browser..." +tar -xvJf $tar_location + +echo "Untarred successfully!" + echo "Checking to see if an older installation exists" if [ -f "$app_bin_in_local_bin" ]; then echo "Old bin file detected, removing..." @@ -36,19 +50,6 @@ if [ -f "$desktop_in_local_applications" ]; then rm "$desktop_in_local_applications" fi -echo "Installing the latest package" -curl -L -o $tar_location $official_package_location -if [ $? -eq 0 ]; then - echo OK -else - echo "Installation failed. Curl not found or not installed" - exit -fi - -tar -xvJf $tar_location - -echo "Installed and untarred successfully" - if [ ! -d $universal_path_for_installation_directory ]; then echo "Creating the $universal_path_for_installation_directory directory for installation" mkdir $universal_path_for_installation_directory