Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion btcpay-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ cd "$BTCPAY_BASE_DIRECTORY/btcpayserver-docker"

if [[ "$1" != "--skip-git-pull" ]]; then
git pull --force
exec "btcpay-update.sh" --skip-git-pull
exec ./btcpay-update.sh --skip-git-pull
return
fi

Expand Down
7 changes: 7 additions & 0 deletions helpers.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# install_tooling and docker_compose_update install into /usr/local/bin, which
# non-interactive shells (cron, `ssh host 'cmd'`) often leave out of PATH.
case ":$PATH:" in
*:/usr/local/bin:*) ;;
*) export PATH="/usr/local/bin:$PATH" ;;
esac

BTCPAY_ENV_VARIABLES=(
BTCPAY_PROTOCOL
BTCPAY_HOST
Expand Down
12 changes: 12 additions & 0 deletions tests/environment-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@ trap 'rm -rf "$test_dir"' EXIT
# shellcheck source=../helpers.sh
. "$repo_dir/helpers.sh"

# helpers.sh must make the tools it installs in /usr/local/bin reachable from a
# non-interactive shell whose PATH does not include it.
# shellcheck disable=SC2016 # $1 and $PATH expand in the child shell
helpers_path="$(env -i PATH=/usr/bin:/bin bash -c '. "$1" && printf %s "$PATH"' _ "$repo_dir/helpers.sh")"
case ":$helpers_path:" in
*:/usr/local/bin:*) ;;
*)
printf 'helpers.sh must add /usr/local/bin to PATH, got %q\n' "$helpers_path" >&2
exit 1
;;
esac

export BTCPAY_ENV_FILE="$test_dir/.env"
export BTCPAY_HOST="example.com"
export BTCPAYGEN_CRYPTO1="btc"
Expand Down
Loading