release: bump version to 0.72.0
Some checks failed
ci / backend (push) Has been cancelled
ci / frontend (push) Has been cancelled
ci / delivery (push) Has been cancelled
release / images (push) Has been cancelled

This commit is contained in:
linkong
2026-06-29 14:05:06 +08:00
parent 3265d22af5
commit 19d5ac0fee
60 changed files with 3702 additions and 678 deletions

84
scripts/harness/lib.sh Executable file
View File

@@ -0,0 +1,84 @@
#!/usr/bin/env bash
set -euo pipefail
harness_candidate_shells() {
local shell
local -a shells=()
if [ -n "${SHELL:-}" ]; then
shells+=("$SHELL")
fi
shells+=(zsh bash)
local seen=""
for shell in "${shells[@]}"; do
if [ -z "$shell" ]; then
continue
fi
if ! command -v "$shell" >/dev/null 2>&1; then
continue
fi
shell="$(command -v "$shell")"
case ":$seen:" in
*":$shell:"*) continue ;;
esac
seen="${seen:+$seen:}$shell"
printf "%s\n" "$shell"
done
}
harness_find_cmd() {
local cmd="$1"
if [[ ! "$cmd" =~ ^[A-Za-z0-9_.+-]+$ ]]; then
printf "invalid command name: %s\n" "$cmd" >&2
return 2
fi
local found=""
found="$(command -v "$cmd" 2>/dev/null || true)"
if [ -n "$found" ] && [ -x "$found" ]; then
printf "%s\n" "$found"
return 0
fi
local shell
while IFS= read -r shell; do
found="$("$shell" -lic "command -v $cmd" 2>/dev/null | sed -n '1p' || true)"
if [ -n "$found" ] && [ -x "$found" ]; then
printf "%s\n" "$found"
return 0
fi
done < <(harness_candidate_shells)
return 1
}
harness_require_tool() {
local cmd="$1"
local found
if ! found="$(harness_find_cmd "$cmd")"; then
printf "missing required command: %s\n" "$cmd" >&2
printf "looked in the current non-interactive PATH and login interactive shells\n" >&2
return 1
fi
harness_prepend_tool_dir "$found"
printf "%s\n" "$found"
}
harness_prepend_tool_dir() {
local path="$1"
local dir
dir="$(dirname "$path")"
case ":$PATH:" in
*":$dir:"*) ;;
*)
PATH="$dir:$PATH"
export PATH
;;
esac
}
harness_run() {
printf "+ %s\n" "$*" >&2
"$@"
}