chief-clancy 0.1.0 → 0.1.1
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 +18 -0
- package/package.json +1 -1
package/bin/install.js
CHANGED
|
@@ -128,6 +128,24 @@ async function main() {
|
|
|
128
128
|
copyDir(COMMANDS_SRC, dest);
|
|
129
129
|
copyDir(WORKFLOWS_SRC, workflowsDest);
|
|
130
130
|
|
|
131
|
+
// For global installs, @-file references in command files resolve relative to the
|
|
132
|
+
// project root — not ~/.claude/ — so the workflow files won't be found at runtime.
|
|
133
|
+
// Fix: inline the workflow content directly into the installed command files.
|
|
134
|
+
if (dest === GLOBAL_DEST) {
|
|
135
|
+
const WORKFLOW_REF = /^@\.claude\/clancy\/workflows\/(.+\.md)$/m;
|
|
136
|
+
for (const file of fs.readdirSync(dest)) {
|
|
137
|
+
if (!file.endsWith('.md')) continue;
|
|
138
|
+
const cmdPath = path.join(dest, file);
|
|
139
|
+
const content = fs.readFileSync(cmdPath, 'utf8');
|
|
140
|
+
const match = content.match(WORKFLOW_REF);
|
|
141
|
+
if (!match) continue;
|
|
142
|
+
const workflowFile = path.join(workflowsDest, match[1]);
|
|
143
|
+
if (!fs.existsSync(workflowFile)) continue;
|
|
144
|
+
const workflowContent = fs.readFileSync(workflowFile, 'utf8');
|
|
145
|
+
fs.writeFileSync(cmdPath, content.replace(match[0], workflowContent));
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
131
149
|
// Write VERSION file so /clancy:doctor and /clancy:update can read the installed version
|
|
132
150
|
fs.writeFileSync(path.join(dest, 'VERSION'), PKG.version);
|
|
133
151
|
|
package/package.json
CHANGED