Skip to content

Commit

Permalink
Quit the script when we hit hard errors
Browse files Browse the repository at this point in the history
a found a few other points where we talk about exiting and re-running
the script once fixed, but never actually exit. So i'm adding-in the
missing exits, and updating any existing exits to make sure we return a
failing return code to the shell
  • Loading branch information
Jeremy Price committed Jan 12, 2024
1 parent 2ee8639 commit 8be3c1a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
echo "!!!!!!!!!!!!!!!!!!!!!!!!! ABORTING THE UPGRADER !!!!!!!!!!!!!!!!!!!!!!\n";
echo "Please correct the issues above in ".getcwd()."/.env and try again.\n";
echo "--------------------------------------------------------\n";
exit;
exit(1);
}


Expand All @@ -168,7 +168,7 @@
echo "Snipe-IT requires PHP versions between ".$php_min_works." and ".$php_max_wontwork.".\n";
echo "Please install a compatible version of PHP and re-run this script again. \n";
echo "!!!!!!!!!!!!!!!!!!!!!!!!! ABORTING THE UPGRADER !!!!!!!!!!!!!!!!!!!!!!\n";
exit;
exit(1);
}

echo "Checking Required PHP extensions... \n\n";
Expand Down Expand Up @@ -256,7 +256,7 @@
echo "ABORTING THE INSTALLER \n";
echo "Please install the extensions above and re-run this script.\n";
echo "--------------------------------------------------------\n";
exit;
exit(1);
} else {
echo $ext_installed."\n";

Expand Down Expand Up @@ -311,6 +311,7 @@
echo "--------------------- !! ERROR !! ----------------------\n";
echo "Please check the permissions on the directories above and re-run this script.\n";
echo "------------------------- :( ---------------------------\n\n";
exit(1);
}


Expand Down

0 comments on commit 8be3c1a

Please sign in to comment.