Merge pull request #1177 from matteo-michele-bianchini/fix/windows-absolute-paths

fix: use ~/ instead of resolved absolute paths in global install
This commit is contained in:
Tom Boucher
2026-03-19 12:08:34 -04:00
committed by GitHub
2 changed files with 106 additions and 3 deletions

View File

@@ -2689,9 +2689,12 @@ function install(isGlobal, runtime = 'claude') {
// Path prefix for file references in markdown content (e.g. gsd-tools.cjs).
// Replaces $HOME/.claude/ or ~/.claude/ so the result is <pathPrefix>get-shit-done/bin/...
// Always use absolute path so: (1) local installs work when GSD is outside $HOME,
// (2) spawned subagents with empty $HOME still resolve the path (fixes #820).
const pathPrefix = `${path.resolve(targetDir).replace(/\\/g, '/')}/`;
// For global installs: use ~/ so paths work across environments (e.g. Docker
// containers mounting ~/.claude from a Windows host where os.homedir() differs).
// For local installs: use resolved absolute path (may be outside $HOME).
const pathPrefix = isGlobal
? path.resolve(targetDir).replace(os.homedir(), '~').replace(/\\/g, '/') + '/'
: `${path.resolve(targetDir).replace(/\\/g, '/')}/`;
let runtimeLabel = 'Claude Code';
if (isOpencode) runtimeLabel = 'OpenCode';