@supercorks/skills-installer 1.2.0 → 1.3.0
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 +22 -7
- package/lib/prompts.js +6 -3
- package/package.json +1 -1
package/bin/install.js
CHANGED
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
updateSubagentsSparseCheckout
|
|
34
34
|
} from '../lib/git.js';
|
|
35
35
|
|
|
36
|
-
const VERSION = '1.
|
|
36
|
+
const VERSION = '1.3.0';
|
|
37
37
|
|
|
38
38
|
// Common installation paths to check for existing installations
|
|
39
39
|
const SKILL_PATHS = ['.github/skills/', '.claude/skills/'];
|
|
@@ -113,6 +113,21 @@ Examples:
|
|
|
113
113
|
`);
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
+
/**
|
|
117
|
+
* Check if a path is already in .gitignore
|
|
118
|
+
* @param {string} gitignorePath - Path to .gitignore file
|
|
119
|
+
* @param {string} pathToCheck - Path to check
|
|
120
|
+
* @returns {boolean}
|
|
121
|
+
*/
|
|
122
|
+
function isInGitignore(gitignorePath, pathToCheck) {
|
|
123
|
+
if (!existsSync(gitignorePath)) {
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
const normalizedPath = pathToCheck.replace(/\/$/, '');
|
|
127
|
+
const content = readFileSync(gitignorePath, 'utf-8');
|
|
128
|
+
return content.includes(normalizedPath);
|
|
129
|
+
}
|
|
130
|
+
|
|
116
131
|
/**
|
|
117
132
|
* Add a path to .gitignore if not already present
|
|
118
133
|
* @param {string} gitignorePath - Path to .gitignore file
|
|
@@ -211,9 +226,10 @@ async function runSkillsInstall() {
|
|
|
211
226
|
|
|
212
227
|
const isManageMode = installedSkills.length > 0;
|
|
213
228
|
|
|
214
|
-
// Ask about .gitignore (only for fresh installs)
|
|
229
|
+
// Ask about .gitignore (only for fresh installs and if not already in .gitignore)
|
|
215
230
|
let shouldGitignore = false;
|
|
216
|
-
|
|
231
|
+
const gitignorePath = resolve(process.cwd(), '.gitignore');
|
|
232
|
+
if (!isManageMode && !isInGitignore(gitignorePath, installPath)) {
|
|
217
233
|
shouldGitignore = await promptGitignore(installPath);
|
|
218
234
|
}
|
|
219
235
|
|
|
@@ -262,7 +278,6 @@ async function runSkillsInstall() {
|
|
|
262
278
|
|
|
263
279
|
// Update .gitignore if requested
|
|
264
280
|
if (shouldGitignore) {
|
|
265
|
-
const gitignorePath = resolve(process.cwd(), '.gitignore');
|
|
266
281
|
addToGitignore(gitignorePath, installPath);
|
|
267
282
|
}
|
|
268
283
|
|
|
@@ -324,9 +339,10 @@ async function runSubagentsInstall() {
|
|
|
324
339
|
|
|
325
340
|
const isManageMode = installedAgents.length > 0;
|
|
326
341
|
|
|
327
|
-
// Ask about .gitignore (only for fresh installs)
|
|
342
|
+
// Ask about .gitignore (only for fresh installs and if not already in .gitignore)
|
|
328
343
|
let shouldGitignore = false;
|
|
329
|
-
|
|
344
|
+
const gitignorePath = resolve(process.cwd(), '.gitignore');
|
|
345
|
+
if (!isManageMode && !isInGitignore(gitignorePath, installPath)) {
|
|
330
346
|
shouldGitignore = await promptGitignore(installPath);
|
|
331
347
|
}
|
|
332
348
|
|
|
@@ -375,7 +391,6 @@ async function runSubagentsInstall() {
|
|
|
375
391
|
|
|
376
392
|
// Update .gitignore if requested
|
|
377
393
|
if (shouldGitignore) {
|
|
378
|
-
const gitignorePath = resolve(process.cwd(), '.gitignore');
|
|
379
394
|
addToGitignore(gitignorePath, installPath);
|
|
380
395
|
}
|
|
381
396
|
|
package/lib/prompts.js
CHANGED
|
@@ -43,9 +43,9 @@ export async function promptInstallType() {
|
|
|
43
43
|
name: 'installType',
|
|
44
44
|
message: 'What would you like to install?',
|
|
45
45
|
choices: [
|
|
46
|
+
{ name: 'Skills and Agents', value: 'both' },
|
|
46
47
|
{ name: 'Skills only', value: 'skills' },
|
|
47
|
-
{ name: '
|
|
48
|
-
{ name: 'Both skills and subagents', value: 'both' }
|
|
48
|
+
{ name: 'Agents only', value: 'subagents' }
|
|
49
49
|
]
|
|
50
50
|
}
|
|
51
51
|
]);
|
|
@@ -247,7 +247,10 @@ function promptItemSelection(items, installedItems = [], title = '📦 Available
|
|
|
247
247
|
readline.emitKeypressEvents(process.stdin, rl);
|
|
248
248
|
|
|
249
249
|
let cursor = 0;
|
|
250
|
-
|
|
250
|
+
// If nothing is installed, select all by default; otherwise pre-select installed items
|
|
251
|
+
const selected = installedItems.length > 0
|
|
252
|
+
? new Set(installedItems)
|
|
253
|
+
: new Set(items.map(item => item.id));
|
|
251
254
|
const expanded = new Set();
|
|
252
255
|
|
|
253
256
|
const render = () => {
|