fix(cli): harden tht installer replacement

This commit is contained in:
2026-08-15 22:10:59 +02:00
parent 5e13396669
commit a2d5a244de
4 changed files with 73 additions and 16 deletions
+3 -1
View File
@@ -41,13 +41,15 @@ write_artifact "$artifact_one" "tht test version one"
write_artifact "$artifact_two" "tht test version two"
system_path=$PATH
installer_bash=${THT_TEST_BASH:-/bin/bash}
test -x "$installer_bash" || fail "THT_TEST_BASH must name an executable Bash interpreter"
run_installer() {
local artifact=$1
THT_INSTALL_DIRECTORY="$test_directory" \
THT_BUILD_ARTIFACT="$artifact" \
THT_BUILD_ARTIFACT_SHA256="$(sha256 "$artifact")" \
PATH="$test_directory:$system_path" \
bash "$installer"
"$installer_bash" "$installer"
}
run_installer "$artifact_one"