Files
cowork-local/scripts/run_local.sh
T
thanhnv b7d223673e
CI / test (pull_request) Canceled after 0s
chore(install): add reproducible local setup
2026-08-11 17:51:21 +07:00

26 lines
712 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
launcher_source=${BASH_SOURCE[0]}
while [[ -L "$launcher_source" ]]; do
launcher_dir=$(cd "$(dirname "$launcher_source")" && pwd)
launcher_target=$(readlink "$launcher_source")
if [[ "$launcher_target" = /* ]]; then
launcher_source="$launcher_target"
else
launcher_source="$launcher_dir/$launcher_target"
fi
done
script_dir=$(cd "$(dirname "$launcher_source")" && pwd)
repo_dir=$(cd "$script_dir/.." && pwd)
python_bin="$repo_dir/.venv/bin/python"
if [[ ! -x "$python_bin" ]]; then
echo "Cowork Local is not installed. Run $repo_dir/scripts/install_local.sh first." >&2
exit 1
fi
cd "$(dirname "$repo_dir")"
exec "$python_bin" -m cowork_local "$@"