diff --git a/deploy.sh b/deploy.sh index 6f8659c..e8ba041 100644 --- a/deploy.sh +++ b/deploy.sh @@ -50,12 +50,12 @@ cd $SERVICE_PATH # Checkout the latest commit on GIT_BRANCH git fetch origin -v -if [ $! -ne 0 ]; then +if [ "$!" -ne 0 ]; then echo "Failed to fetch." exit 1 fi git checkout origin/$GIT_BRANCH -if [ $! -ne 0 ]; then +if [ "$!" -ne 0 ]; then echo "Failed to checkout the latest commit." exit 1 fi @@ -63,15 +63,15 @@ fi # Install the dependencies yarn install --frozen-lockfile --non-interactive --verbose -if [ $! -ne 0 ]; then +if [ "$!" -ne 0 ]; then echo "Failed to install the dependencies." exit 1 fi # We use build:only here, because we don't want to run any checks beforehand. Those are handled by GH Actions. -yarn build:only --verbose +yarn build:only -if [ $! -ne 0 ]; then +if [ "$!" -ne 0 ]; then echo "Failed to build, this should be unreachable." echo "Ignoring this, since tsc transpiles everything regardless of errors." echo "This should have been caught by GH Actions." @@ -80,7 +80,7 @@ fi if [ ! -z "$(screen -ls $SERVICE_NAME | grep $SERVICE_NAME)" ]; then echo "Service is already running, stopping it." screen -S $SERVICE_NAME -X quit - if [ $! -ne 0 ]; then + if [ "$!" -ne 0 ]; then echo "Failed to stop the service." exit 1 fi @@ -89,7 +89,7 @@ fi echo "Starting the service." screen -dmqS $SERVICE_NAME yarn start -if [ $! -ne 0 ]; then +if [ "$!" -ne 0 ]; then echo "Failed to start the service." exit 1 fi \ No newline at end of file