Skip to content

Commit e0c0c87

Browse files
committed
Use sibling agentctl path without executable-bit dependency
1 parent cb7fd32 commit e0c0c87

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

assets/sourceos/bin/turtle-cloudfog

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,27 @@ set -eu
44

55
bin_dir="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
66
agentctl="$bin_dir/turtle-agentctl"
7-
if [ ! -x "$agentctl" ]; then
8-
agentctl="turtle-agentctl"
7+
if [ -f "$agentctl" ]; then
8+
agentctl_prefix="python3 $agentctl"
9+
else
10+
agentctl_prefix="turtle-agentctl"
911
fi
1012

1113
cmd="${1:-surfaces}"
1214
case "$cmd" in
1315
surfaces)
1416
shift || true
15-
exec "$agentctl" --stdio cloudfog-surfaces "$@"
17+
exec $agentctl_prefix --stdio cloudfog-surfaces "$@"
1618
;;
1719
inspect)
1820
shift || true
19-
exec "$agentctl" --stdio cloudfog-inspect "$@"
21+
exec $agentctl_prefix --stdio cloudfog-inspect "$@"
2022
;;
2123
request-execution)
2224
shift || true
2325
surface="${1:-cloudfog/local-devshell}"
2426
shift || true
25-
exec "$agentctl" --stdio request-surface-execution "$surface" "$@"
27+
exec $agentctl_prefix --stdio request-surface-execution "$surface" "$@"
2628
;;
2729
*)
2830
echo "usage: turtle-cloudfog [surfaces|inspect <surface>|request-execution <surface> -- <command>]" >&2

0 commit comments

Comments
 (0)