get-shit-done-cc 1.3.23 → 1.3.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/install.js +21 -3
- package/package.json +1 -1
package/bin/install.js
CHANGED
|
@@ -35,6 +35,16 @@ const hasLocal = args.includes('--local') || args.includes('-l');
|
|
|
35
35
|
|
|
36
36
|
console.log(banner);
|
|
37
37
|
|
|
38
|
+
/**
|
|
39
|
+
* Expand ~ to home directory (shell doesn't expand in env vars passed to node)
|
|
40
|
+
*/
|
|
41
|
+
function expandTilde(filePath) {
|
|
42
|
+
if (filePath && filePath.startsWith('~/')) {
|
|
43
|
+
return path.join(os.homedir(), filePath.slice(2));
|
|
44
|
+
}
|
|
45
|
+
return filePath;
|
|
46
|
+
}
|
|
47
|
+
|
|
38
48
|
/**
|
|
39
49
|
* Recursively copy directory, replacing paths in .md files
|
|
40
50
|
*/
|
|
@@ -65,8 +75,10 @@ function copyWithPathReplacement(srcDir, destDir, pathPrefix) {
|
|
|
65
75
|
*/
|
|
66
76
|
function install(isGlobal) {
|
|
67
77
|
const src = path.join(__dirname, '..');
|
|
78
|
+
const configDir = expandTilde(process.env.CLAUDE_CONFIG_DIR);
|
|
79
|
+
const defaultGlobalDir = configDir || path.join(os.homedir(), '.claude');
|
|
68
80
|
const claudeDir = isGlobal
|
|
69
|
-
?
|
|
81
|
+
? defaultGlobalDir
|
|
70
82
|
: path.join(process.cwd(), '.claude');
|
|
71
83
|
|
|
72
84
|
const locationLabel = isGlobal
|
|
@@ -74,7 +86,10 @@ function install(isGlobal) {
|
|
|
74
86
|
: claudeDir.replace(process.cwd(), '.');
|
|
75
87
|
|
|
76
88
|
// Path prefix for file references
|
|
77
|
-
|
|
89
|
+
// Use actual path when CLAUDE_CONFIG_DIR is set, otherwise use ~ shorthand
|
|
90
|
+
const pathPrefix = isGlobal
|
|
91
|
+
? (configDir ? `${claudeDir}/` : '~/.claude/')
|
|
92
|
+
: './.claude/';
|
|
78
93
|
|
|
79
94
|
console.log(` Installing to ${cyan}${locationLabel}${reset}\n`);
|
|
80
95
|
|
|
@@ -108,9 +123,12 @@ function promptLocation() {
|
|
|
108
123
|
output: process.stdout
|
|
109
124
|
});
|
|
110
125
|
|
|
126
|
+
const globalPath = expandTilde(process.env.CLAUDE_CONFIG_DIR) || path.join(os.homedir(), '.claude');
|
|
127
|
+
const globalLabel = globalPath.replace(os.homedir(), '~');
|
|
128
|
+
|
|
111
129
|
console.log(` ${yellow}Where would you like to install?${reset}
|
|
112
130
|
|
|
113
|
-
${cyan}1${reset}) Global ${dim}(
|
|
131
|
+
${cyan}1${reset}) Global ${dim}(${globalLabel})${reset} - available in all projects
|
|
114
132
|
${cyan}2${reset}) Local ${dim}(./.claude)${reset} - this project only
|
|
115
133
|
`);
|
|
116
134
|
|
package/package.json
CHANGED