Introduce new environment variables to control the behavior of one-time download boxes: - `WARPBOX_ONE_TIME_DOWNLOAD_EXPIRY_SECONDS`: Sets the lifetime of a one-time box after uploads are complete. - `WARPBOX_ONE_TIME_DOWNLOAD_RETRY_ON_FAILURE`: Determines whether a box remains available if the ZIP creation or transfer fails. To support these settings, the ZIP delivery process was refactored to use a temporary file. This ensures that a one-time box is only marked as consumed after the file has been successfully transferred to the client, preventing data loss on network interruptions. Additionally, added a `DecorateFiles` helper in the box store to reduce code duplication.
18 lines
385 B
Bash
Executable File
18 lines
385 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
if [ -n "${GO_BIN:-}" ]; then
|
|
go_bin="$GO_BIN"
|
|
elif command -v go >/dev/null 2>&1; then
|
|
go_bin="$(command -v go)"
|
|
elif [ -x /home/linuxbrew/.linuxbrew/bin/go ]; then
|
|
go_bin=/home/linuxbrew/.linuxbrew/bin/go
|
|
else
|
|
echo "go not found. Set GO_BIN=/path/to/go or install Go." >&2
|
|
exit 127
|
|
fi
|
|
|
|
"$go_bin" test ./... "$@"
|