From d2b1bef686fd6c22a6303c13829f88bdd110fa7b Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sat, 18 Jul 2026 20:08:56 -0500 Subject: feat(bin): launch install-ai from PATH Added claude-templates/bin/install-ai, a thin launcher that resolves its own path through the symlink chain and execs scripts/install-ai.sh. make install's bin loop symlinks it into ~/.local/bin/install-ai, the same mechanism that links ai and agent-page, so the fresh-project bootstrapper now runs as install-ai from anywhere. The symlink always points at the canonical, so no separate dotfiles copy is needed. Three launcher bats cover the wrapper, including invocation through a symlink from another directory (the case a naive dirname "$0"/.. would break). --- claude-templates/bin/install-ai | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 claude-templates/bin/install-ai (limited to 'claude-templates') diff --git a/claude-templates/bin/install-ai b/claude-templates/bin/install-ai new file mode 100755 index 0000000..88cb8e5 --- /dev/null +++ b/claude-templates/bin/install-ai @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +# install-ai — PATH-facing launcher for the fresh-project bootstrapper. +# +# make install symlinks this into ~/.local/bin/install-ai (same bin loop that +# links `ai` and `agent-page`), so `install-ai [--track|--gitignore] [PROJECT]` +# runs from anywhere. The real logic lives in scripts/install-ai.sh; this +# resolves its own location through the ~/.local/bin symlink and execs that +# script by its true repo path, so the script's own repo-root computation +# (dirname "$0"/..) stays correct. dotfiles needs no copy — the symlink always +# points at the canonical. +set -euo pipefail + +# Resolve this file through any symlink chain to its real location in the repo. +source="${BASH_SOURCE[0]}" +while [ -L "$source" ]; do + dir="$(cd -P "$(dirname "$source")" && pwd)" + source="$(readlink "$source")" + [[ "$source" != /* ]] && source="$dir/$source" +done +bindir="$(cd -P "$(dirname "$source")" && pwd)" # /claude-templates/bin +repo="$(cd -P "$bindir/../.." && pwd)" # + +exec "$repo/scripts/install-ai.sh" "$@" -- cgit v1.2.3