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
17 changes: 14 additions & 3 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -472,13 +472,24 @@ success "Image pulled"
# ─────────────────────────────────────────────────────────────────────────────
install_cli_wrapper() {
info "Installing 'clawforce' CLI wrapper..."
local install_dir="$HOME/.local/bin"
local wrapper_path="$install_dir/clawforce"

# Ensure we're in a valid directory (avoids "chdir: cannot access parent" when cwd is stale)
cd "${TMPDIR:-/tmp}" 2>/dev/null || cd /tmp 2>/dev/null || true

mkdir -p "$install_dir"
# Pick an install directory the current user can write to
local install_dir
for _candidate in "$HOME/.local/bin" "$HOME/bin" "$HOME/.bin"; do
if mkdir -p "$_candidate" 2>/dev/null; then
install_dir="$_candidate"
break
fi
done
if [ -z "$install_dir" ]; then
warn "Could not create a writable bin directory under \$HOME. Skipping CLI wrapper."
return 1
fi

local wrapper_path="$install_dir/clawforce"

local tmpfile
tmpfile="$(mktemp)" || { warn "Could not create temp file. Skipping CLI wrapper."; return 1; }
Expand Down
Loading