mdma-cli 4.5.0 → 4.5.2
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/init.js +14 -3
- package/package.json +1 -1
package/bin/init.js
CHANGED
|
@@ -89,14 +89,23 @@ function copyDirRecursive(src, dest) {
|
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
function updateGitExclude() {
|
|
92
|
-
const
|
|
92
|
+
const gitDir = join(process.cwd(), '.git');
|
|
93
|
+
const infoDir = join(gitDir, 'info');
|
|
94
|
+
const excludePath = join(infoDir, 'exclude');
|
|
93
95
|
|
|
94
|
-
if (!existsSync(
|
|
96
|
+
if (!existsSync(gitDir)) {
|
|
95
97
|
return false;
|
|
96
98
|
}
|
|
97
99
|
|
|
100
|
+
const linesToAdd = ['# mdma-cli', '.claude/rules/mdma/', '.claude/skills/mdma/', '.claude/subagents/mdma/'];
|
|
101
|
+
|
|
102
|
+
if (!existsSync(excludePath)) {
|
|
103
|
+
mkdirSync(infoDir, { recursive: true });
|
|
104
|
+
appendFileSync(excludePath, linesToAdd.join('\n') + '\n');
|
|
105
|
+
return 'created';
|
|
106
|
+
}
|
|
107
|
+
|
|
98
108
|
const content = readFileSync(excludePath, 'utf-8');
|
|
99
|
-
const linesToAdd = ['# Claude Code', 'CLAUDE.md', '.claude/'];
|
|
100
109
|
const missingLines = linesToAdd.filter(line => !content.includes(line));
|
|
101
110
|
|
|
102
111
|
if (missingLines.length === 0) {
|
|
@@ -233,6 +242,8 @@ function add(args) {
|
|
|
233
242
|
const excludeResult = updateGitExclude();
|
|
234
243
|
if (excludeResult === true) {
|
|
235
244
|
console.log(` [ok] .git/info/exclude (updated)`);
|
|
245
|
+
} else if (excludeResult === 'created') {
|
|
246
|
+
console.log(` [ok] .git/info/exclude (created)`);
|
|
236
247
|
} else if (excludeResult === 'already') {
|
|
237
248
|
console.log(` [skip] .git/info/exclude (already configured)`);
|
|
238
249
|
} else {
|