get-shit-done-cc 1.0.6 → 1.0.8
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
CHANGED
|
@@ -35,6 +35,31 @@ const hasLocal = args.includes('--local') || args.includes('-l');
|
|
|
35
35
|
|
|
36
36
|
console.log(banner);
|
|
37
37
|
|
|
38
|
+
/**
|
|
39
|
+
* Recursively copy directory, replacing paths in .md files
|
|
40
|
+
*/
|
|
41
|
+
function copyWithPathReplacement(srcDir, destDir, pathPrefix) {
|
|
42
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
43
|
+
|
|
44
|
+
const entries = fs.readdirSync(srcDir, { withFileTypes: true });
|
|
45
|
+
|
|
46
|
+
for (const entry of entries) {
|
|
47
|
+
const srcPath = path.join(srcDir, entry.name);
|
|
48
|
+
const destPath = path.join(destDir, entry.name);
|
|
49
|
+
|
|
50
|
+
if (entry.isDirectory()) {
|
|
51
|
+
copyWithPathReplacement(srcPath, destPath, pathPrefix);
|
|
52
|
+
} else if (entry.name.endsWith('.md')) {
|
|
53
|
+
// Replace ~/.claude/ with the appropriate prefix in markdown files
|
|
54
|
+
let content = fs.readFileSync(srcPath, 'utf8');
|
|
55
|
+
content = content.replace(/~\/\.claude\//g, pathPrefix);
|
|
56
|
+
fs.writeFileSync(destPath, content);
|
|
57
|
+
} else {
|
|
58
|
+
fs.copyFileSync(srcPath, destPath);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
38
63
|
/**
|
|
39
64
|
* Install to the specified directory
|
|
40
65
|
*/
|
|
@@ -48,22 +73,25 @@ function install(isGlobal) {
|
|
|
48
73
|
? claudeDir.replace(os.homedir(), '~')
|
|
49
74
|
: claudeDir.replace(process.cwd(), '.');
|
|
50
75
|
|
|
76
|
+
// Path prefix for file references
|
|
77
|
+
const pathPrefix = isGlobal ? '~/.claude/' : './.claude/';
|
|
78
|
+
|
|
51
79
|
console.log(` Installing to ${cyan}${locationLabel}${reset}\n`);
|
|
52
80
|
|
|
53
81
|
// Create commands directory
|
|
54
82
|
const commandsDir = path.join(claudeDir, 'commands');
|
|
55
83
|
fs.mkdirSync(commandsDir, { recursive: true });
|
|
56
84
|
|
|
57
|
-
// Copy commands/gsd
|
|
85
|
+
// Copy commands/gsd with path replacement
|
|
58
86
|
const gsdSrc = path.join(src, 'commands', 'gsd');
|
|
59
87
|
const gsdDest = path.join(commandsDir, 'gsd');
|
|
60
|
-
|
|
88
|
+
copyWithPathReplacement(gsdSrc, gsdDest, pathPrefix);
|
|
61
89
|
console.log(` ${green}✓${reset} Installed commands/gsd`);
|
|
62
90
|
|
|
63
|
-
// Copy get-shit-done skill
|
|
91
|
+
// Copy get-shit-done skill with path replacement
|
|
64
92
|
const skillSrc = path.join(src, 'get-shit-done');
|
|
65
93
|
const skillDest = path.join(claudeDir, 'get-shit-done');
|
|
66
|
-
|
|
94
|
+
copyWithPathReplacement(skillSrc, skillDest, pathPrefix);
|
|
67
95
|
console.log(` ${green}✓${reset} Installed get-shit-done`);
|
|
68
96
|
|
|
69
97
|
console.log(`
|
package/package.json
CHANGED