From 08729a2e8e9121deb90c77b34027d03211662bc2 Mon Sep 17 00:00:00 2001 From: RedLeaderOne Date: Sat, 14 Sep 2024 12:57:19 -0400 Subject: [PATCH] fix(build): ensure script exits on directory change failure - Added 'exit 1' to all directory change (cd) commands to ensure the script exits if they fail. - This prevents the script from continuing in an incorrect directory and potentially causing errors. --- .../ubuntu/lpm_install_libpointmatcher_ubuntu.bash | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build_system/ubuntu/lpm_install_libpointmatcher_ubuntu.bash b/build_system/ubuntu/lpm_install_libpointmatcher_ubuntu.bash index cacff7fe..7adceff9 100644 --- a/build_system/ubuntu/lpm_install_libpointmatcher_ubuntu.bash +++ b/build_system/ubuntu/lpm_install_libpointmatcher_ubuntu.bash @@ -53,7 +53,7 @@ export DEBIAN_FRONTEND=noninteractive TMP_CWD=$(pwd) LPM_PATH=$(git rev-parse --show-toplevel) -cd "${LPM_PATH}/build_system" || exit +cd "${LPM_PATH}/build_system" || exit 1 # ....Load environment variables from file......................................................... set -o allexport @@ -176,7 +176,7 @@ teamcity_service_msg_blockOpened "Install ${NBS_REPOSITORY_NAME}" mkdir -p "${NBS_LIB_INSTALL_PATH}" print_msg "Directories (pre libpointmatcher install)$(tree -L 2 "${NBS_LIB_INSTALL_PATH}")" -cd "${NBS_LIB_INSTALL_PATH}" || exit +cd "${NBS_LIB_INSTALL_PATH}" || exit 1 # ....Repository cloning step...................................................................... if [[ ${BUILD_SYSTEM_CI_INSTALL} == FALSE ]]; then @@ -188,7 +188,7 @@ if [[ ${BUILD_SYSTEM_CI_INSTALL} == FALSE ]]; then git clone https://github.com/"${NBS_REPOSITORY_DOMAIN}"/"${NBS_REPOSITORY_NAME}".git if [[ "${REPOSITORY_VERSION}" != 'latest' ]]; then - cd "${NBS_REPOSITORY_NAME}" || exit + cd "${NBS_REPOSITORY_NAME}" || exit 1 git fetch --tags git tag --list @@ -203,7 +203,7 @@ if [[ ${BUILD_SYSTEM_CI_INSTALL} == FALSE ]]; then fi fi -cd "${NBS_LIB_INSTALL_PATH}/${NBS_REPOSITORY_NAME}" || exit +cd "${NBS_LIB_INSTALL_PATH}/${NBS_REPOSITORY_NAME}" || exit 1 mkdir -p build && cd build # ....Cmake install step........................................................................... @@ -279,4 +279,4 @@ fi print_formated_script_footer "${CALLER_NAME} (${IMAGE_ARCH_AND_OS})" "${MSG_LINE_CHAR_INSTALLER}" # ====Teardown===================================================================================== -cd "${TMP_CWD}" || exit +cd "${TMP_CWD}" || exit 1