Add dynamic tool path detection in install.sh#216
Add dynamic tool path detection in install.sh#216Shiven0504 wants to merge 2 commits intomsitarzewski:mainfrom
Conversation
Replace hardcoded install paths with a flexible resolution system: --path flag > environment variable > default path. - Add --path <dir> flag to override install directory for any tool - Add env var support (CLAUDE_CONFIG_DIR, COPILOT_AGENT_DIR, etc.) - Warn when parent directories don't exist before creating them - Add VS Code chat.agentFilesLocations hint after Copilot install Closes msitarzewski#205, addresses msitarzewski#185
msitarzewski
left a comment
There was a problem hiding this comment.
Hey @Shiven0504 — nice work here! The --path flag is a great addition and the resolve_path() / warn_if_missing pattern is clean. This covers #205, #185, and #218 in one shot, which is exactly what we need.
One ask before we merge: could you drop the per-tool environment variables (CLAUDE_CONFIG_DIR, COPILOT_AGENT_DIR, ANTIGRAVITY_DIR, etc.)? The --path flag already gives users the escape hatch for non-standard installs, so the env vars add documentation and maintenance surface without a clear use case driving them. Keeping just --path keeps things tight.
That means:
- Remove the env var block from the header comments
- Simplify
resolve_path()to just checkCUSTOM_PATHvs default (two tiers instead of three) - Drop the
${CLAUDE_CONFIG_DIR:+...},${COPILOT_AGENT_DIR:-...}, etc. from each installer call
Everything else looks good to go. Thanks for putting this together!
Address PR review feedback: drop CLAUDE_CONFIG_DIR, COPILOT_AGENT_DIR, and other per-tool environment variables. The --path flag is sufficient as the single escape hatch for non-standard installs.
ab66a91 to
552a555
Compare
|
Hii @msitarzewski , thanks for the review! I've done the 3 changes -
The --path flag (line 526), warn_if_missing (line 285) and the copilot VS Code hint (line 345) are all still in place. Let me know if anything else needs modification! |
|
Also, I noticed the repo has lint-agents.sh but no test suite for install.sh. Would you like me to add a dry-run mode (--dry-run) that prints what would happen without copying files which would make it easier to test. I can implement something like that in future, or perhaps it would be better if i open up a new discussion before doing anything new 😄 |
Summary
--path <dir>flag to override the default install directory for any toolCLAUDE_CONFIG_DIR,COPILOT_AGENT_DIR,CURSOR_RULES_DIR, etc.) checked before hardcoded defaultschat.agentFilesLocationshint after Copilot install (addresses install script uses wrong location for vscode copilot #185)Path resolution priority:
--pathflag > env var > defaultTest plan
./scripts/install.sh --tool cursor --path /tmp/test-cursorinstalls to custom pathCLAUDE_CONFIG_DIR=/tmp/test-claude ./scripts/install.sh --tool claude-coderespects env var./scripts/install.sh --tool copilotshows VS Code settings hint./scripts/install.sh --path /tmp/test(without--tool) exits with error--pathor env vars are set./scripts/install.sh --helpshows updated usage with new flags and env varsCloses #205
Addresses #185