From e12d01a71191fb93ab449979a6a2d2d67d155762 Mon Sep 17 00:00:00 2001 From: RedLeaderOne Date: Sat, 16 Dec 2023 13:10:32 -0500 Subject: [PATCH] style: refactor environment variable name to reflect change in `norlab-build-system` repository --- .env.project | 4 +--- import_norlab_shell_script_tools_lib.bash | 4 ++-- tests/tests_template/run_bats_core_test_in_n2st.bash | 8 ++++---- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.env.project b/.env.project index 5942444..a3f02ec 100644 --- a/.env.project +++ b/.env.project @@ -26,10 +26,8 @@ #PROJECT_PROMPT_NAME="" -# Programaticaly fetch repository information +# ....Programaticaly fetch source code information................................................. PROJECT_GIT_REMOTE_URL=$( git remote get-url origin ) PROJECT_GIT_NAME=$( basename "${PROJECT_GIT_REMOTE_URL}" .git ) - -# Programaticaly fetch source code information PROJECT_PATH=$( git rev-parse --show-toplevel ) PROJECT_SRC_NAME="$( basename ${PROJECT_PATH} )" diff --git a/import_norlab_shell_script_tools_lib.bash b/import_norlab_shell_script_tools_lib.bash index 14b3025..935d9c7 100644 --- a/import_norlab_shell_script_tools_lib.bash +++ b/import_norlab_shell_script_tools_lib.bash @@ -27,10 +27,10 @@ function n2st::source_lib(){ # Note: can handle both sourcing cases # i.e. from within a script or from an interactive terminal session _PATH_TO_SCRIPT="$(realpath "${BASH_SOURCE[0]:-'.'}")" - _PATH_TO_SCRIPT_DIR="$(dirname "${_PATH_TO_SCRIPT}")" + _REPO_ROOT="$(dirname "${_PATH_TO_SCRIPT}")" # ....Load environment variables from file....................................................... - cd "${_PATH_TO_SCRIPT_DIR}" || exit + cd "${_REPO_ROOT}" || exit set -o allexport source .env.n2st set +o allexport diff --git a/tests/tests_template/run_bats_core_test_in_n2st.bash b/tests/tests_template/run_bats_core_test_in_n2st.bash index 9f5fd8a..e70ddc7 100644 --- a/tests/tests_template/run_bats_core_test_in_n2st.bash +++ b/tests/tests_template/run_bats_core_test_in_n2st.bash @@ -20,11 +20,11 @@ # Read N2ST_PATH Default to "./utilities/norlab-shell-script-tools" # # ================================================================================================= -OPTIONS="$@" +PARAMS="$@" -if [[ -z $OPTIONS ]]; then +if [[ -z $PARAMS ]]; then # Set to default bats tests directory if none specified - OPTIONS="tests/" + PARAMS="tests/" fi @@ -38,7 +38,7 @@ function n2st::run_n2st_testsing_tools(){ # ....Execute N2ST run_bats_tests_in_docker.bash................................................. cd "$SUPERPROJECT_PATH" - bash "${N2ST_PATH}/tests/bats_testing_tools/run_bats_tests_in_docker.bash" "$OPTIONS" + bash "${N2ST_PATH}/tests/bats_testing_tools/run_bats_tests_in_docker.bash" "$PARAMS" # ....Teardown................................................................................... cd "$TMP_CWD"