Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion cli/desktop-act
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
#!/usr/bin/env bash
# Portable entrypoint for the desktop-act stdio CLI.
# Resolves the Python next to this repo (venv if present), else system python3.
# Follows symlinks so ~/.local/bin/desktop-act works when linked to this file.
set -euo pipefail

ROOT="$(cd "$(dirname "$0")/.." && pwd)"
SOURCE="${BASH_SOURCE[0]}"
while [[ -L "$SOURCE" ]]; do
DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
LINK="$(readlink "$SOURCE")"
if [[ "$LINK" == /* ]]; then
SOURCE="$LINK"
else
SOURCE="$DIR/$LINK"
fi
done
ROOT="$(cd -P "$(dirname "$SOURCE")/.." && pwd)"
VENV_PY="${DESKTOP_ACT_VENV:-$ROOT/.venv}/bin/python"
if [[ -x "$VENV_PY" ]]; then
exec "$VENV_PY" "$ROOT/cli/desktop_act_cli.py" "$@"
Expand Down
Loading