From: Thomas Walker Lynch Date: Wed, 30 Oct 2024 01:53:19 +0000 (+0000) Subject: env tweaks X-Git-Url: https://git.reasoningtechnology.com/style/static/git-logo.png?a=commitdiff_plain;h=3c0548063812015e996f0dc50c210cc68f55c1b3;p=Mosaic env tweaks --- diff --git a/developer/tool/env b/developer/tool/env index 26e049e..66446d4 100644 --- a/developer/tool/env +++ b/developer/tool/env @@ -4,15 +4,16 @@ script_afp=$(realpath "${BASH_SOURCE[0]}") # input guards env_must_be="tool_shared/bespoke/env" + error=false if [ "$ENV" != "$env_must_be" ]; then echo "$(script_fp):: error: must be run in the $env_must_be environment" - exit 1 + error=true fi - if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then - echo "$script_name:: This script must be sourced, not executed." - exit 1 + echo "$script_afp:: This script must be sourced, not executed." + error=true fi + if $error; then exit 1; fi # so we can do the build diff --git a/document/todo.txt b/document/todo.txt index b812708..7f86390 100644 --- a/document/todo.txt +++ b/document/todo.txt @@ -24,5 +24,6 @@ Updates for Ariadne 5. make_source_tree also integrated into make -6. replacement for bespoke/env +6. replacement for bespoke/env and all other env files + diff --git a/env_administrator b/env_administrator index 25591f4..0fc10de 100644 --- a/env_administrator +++ b/env_administrator @@ -1,5 +1,9 @@ #!/usr/bin/env bash script_afp=$(realpath "${BASH_SOURCE[0]}") +if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then + echo "$script_afp:: This script must be sourced, not executed." + exit 1 +fi source tool_shared/bespoke/env diff --git a/env_developer b/env_developer index 5593044..6240b20 100644 --- a/env_developer +++ b/env_developer @@ -1,5 +1,9 @@ #!/usr/bin/env bash script_afp=$(realpath "${BASH_SOURCE[0]}") +if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then + echo "$script_afp:: This script must be sourced, not executed." + exit 1 +fi source tool_shared/bespoke/env source developer/tool/env diff --git a/env_tester b/env_tester index b7d4d78..44aace3 100644 --- a/env_tester +++ b/env_tester @@ -1,5 +1,9 @@ #!/usr/bin/env bash script_afp=$(realpath "${BASH_SOURCE[0]}") +if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then + echo "$script_afp:: This script must be sourced, not executed." + exit 1 +fi source tool_shared/bespoke/env source tester/tool/env diff --git a/tester/tool/env b/tester/tool/env index 01ffc74..322258e 100644 --- a/tester/tool/env +++ b/tester/tool/env @@ -4,15 +4,16 @@ script_afp=$(realpath "${BASH_SOURCE[0]}") # input guards env_must_be="tool_shared/bespoke/env" + error=false if [ "$ENV" != "$env_must_be" ]; then echo "$(script_fp):: error: must be run in the $env_must_be environment" - exit 1 + error=true fi - if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then - echo "$script_name:: This script must be sourced, not executed." - exit 1 + echo "$script_afp:: This script must be sourced, not executed." + error=true fi + if $error; then exit 1; fi # so we can do testing diff --git a/tool_shared/bespoke/env b/tool_shared/bespoke/env index 849287f..59f8f96 100644 --- a/tool_shared/bespoke/env +++ b/tool_shared/bespoke/env @@ -1,5 +1,9 @@ #!/usr/bin/env bash script_afp=$(realpath "${BASH_SOURCE[0]}") +if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then + echo "$script_afp:: This script must be sourced, not executed." + exit 1 +fi # This is the base environment shared by all roles in the project.