From 3990e354b2d6e7a8b0cbec5bc41d1210b8984284 Mon Sep 17 00:00:00 2001 From: Daniel Goldberg Date: Sun, 9 Feb 2020 11:53:06 +0200 Subject: [PATCH] Add error handling. Remove usage of cd --- deployment_scripts/deploy_linux.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/deployment_scripts/deploy_linux.sh b/deployment_scripts/deploy_linux.sh index 90a6f0769..28dabc0f6 100755 --- a/deployment_scripts/deploy_linux.sh +++ b/deployment_scripts/deploy_linux.sh @@ -91,7 +91,7 @@ fi # Create folders log_message "Creating island dirs under $ISLAND_PATH" -mkdir -p "${MONGO_PATH}" +mkdir -p "${MONGO_PATH}" || handle_error mkdir -p "${ISLAND_BINARIES_PATH}" || handle_error # Detecting command that calls python 3.7 @@ -165,10 +165,6 @@ sudo apt-get install openssl # Generate SSL certificate log_message "Generating certificate" -cd "${ISLAND_PATH}" || { - echo "cd failed" - exit 1 -} "${ISLAND_PATH}"/linux/create_certificate.sh ${ISLAND_PATH}/cc @@ -184,12 +180,13 @@ if ! exists npm; then sudo apt-get install -y nodejs fi -cd "$ISLAND_PATH/cc/ui" || handle_error +pushd "$ISLAND_PATH/cc/ui" || handle_error npm install sass-loader node-sass webpack --save-dev npm update log_message "Generating front end" npm run dist +popd || handle_error # Making dir for binaries mkdir "${MONKEY_BIN_DIR}"