fix: 通过主工作区契约委派 tran
This commit is contained in:
+13
-4
@@ -1,11 +1,20 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
self_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
||||
primary_workspace=$(CDPATH= cd -- "$self_dir/../../.." && pwd)
|
||||
shared_tran="$primary_workspace/scripts/tran"
|
||||
primary_workspace=${AGENTRUN_WORKSPACE_PATH:-}
|
||||
|
||||
if [ ! -x "$shared_tran" ]; then
|
||||
case "$primary_workspace" in
|
||||
/*) ;;
|
||||
*)
|
||||
printf '%s\n' '{"ok":false,"failureKind":"tool-unavailable","message":"runner did not provide an absolute primary workspace path","source":"primary-workspace","valuesPrinted":false}' >&2
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
|
||||
shared_tran="$primary_workspace/scripts/tran"
|
||||
shared_cli="$primary_workspace/scripts/ssh-cli.ts"
|
||||
|
||||
if [ ! -x "$shared_tran" ] || [ ! -f "$shared_cli" ]; then
|
||||
printf '%s\n' '{"ok":false,"failureKind":"tool-unavailable","message":"primary UniDesk workspace does not provide executable scripts/tran","source":"primary-workspace","valuesPrinted":false}' >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user