mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-28 06:31:11 +00:00
ci: hydrate provider env for testbox commands
This commit is contained in:
parent
2860592302
commit
0bdc1d0375
3 changed files with 51 additions and 8 deletions
32
scripts/ci-hydrate-testbox-env.sh
Executable file
32
scripts/ci-hydrate-testbox-env.sh
Executable file
|
|
@ -0,0 +1,32 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
profile_path="${1:-$HOME/.openclaw-testbox-live.profile}"
|
||||
helper_path="${2:-$HOME/.local/bin/openclaw-testbox-env}"
|
||||
|
||||
mkdir -p "$(dirname "$helper_path")"
|
||||
|
||||
bash scripts/ci-hydrate-live-auth.sh "$profile_path"
|
||||
|
||||
cat >"$helper_path" <<'SH'
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
profile_path="${OPENCLAW_TESTBOX_PROFILE_FILE:-$HOME/.openclaw-testbox-live.profile}"
|
||||
if [[ ! -f "$profile_path" ]]; then
|
||||
echo "Missing Testbox provider env profile: $profile_path" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
set -a
|
||||
# shellcheck disable=SC1090
|
||||
source "$profile_path"
|
||||
set +a
|
||||
|
||||
if [[ "$#" -eq 0 ]]; then
|
||||
exec "${SHELL:-/bin/bash}"
|
||||
fi
|
||||
|
||||
exec "$@"
|
||||
SH
|
||||
chmod 700 "$helper_path"
|
||||
Loading…
Add table
Add a link
Reference in a new issue