From 032d1fac562498b1d4c54f06978d38807b7d435b Mon Sep 17 00:00:00 2001 From: samosvalishe Date: Mon, 7 Sep 2026 03:12:46 +0300 Subject: [PATCH] fix: installer --- scripts/install.sh | 2 +- scripts/tests/installer.bats | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/install.sh b/scripts/install.sh index f269a62..06dab33 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -2456,6 +2456,6 @@ main() { fi } -if [ "${BASH_SOURCE[0]}" = "$0" ]; then +if [ "${BASH_SOURCE[0]:-$0}" = "$0" ]; then main "$@" fi diff --git a/scripts/tests/installer.bats b/scripts/tests/installer.bats index fed566f..6fe932d 100644 --- a/scripts/tests/installer.bats +++ b/scripts/tests/installer.bats @@ -433,3 +433,9 @@ EOF " [ "$status" -ne 0 ] } + +@test "запуск через пайп (curl | bash) корректно обрабатывает параметры без ошибки unbound variable" { + run bash -c "cat '$SCRIPT' | bash -s -- -h" + [ "$status" -eq 0 ] + [[ "$output" == *"Free Turn Proxy & AmneziaWG"* ]] +}