@supercorks/skills-installer 1.11.0 → 1.11.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/README.md +1 -1
- package/bin/install.js +15 -2
- package/lib/git.js +18 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ npx @supercorks/skills-installer install
|
|
|
27
27
|
- `.claude/agents/` (Claude)
|
|
28
28
|
- Custom path of your choice
|
|
29
29
|
|
|
30
|
-
3. **Gitignore option** -
|
|
30
|
+
3. **Gitignore option** - If launched from inside a git repository, optionally add the installation path to `.gitignore`
|
|
31
31
|
|
|
32
32
|
4. **Select skills/subagents** - Interactive checkbox to pick what to install:
|
|
33
33
|
- Use `↑`/`↓` to navigate
|
package/bin/install.js
CHANGED
|
@@ -27,6 +27,7 @@ import { fetchAvailableSubagents, fetchSubagentMetadata } from '../lib/subagents
|
|
|
27
27
|
import {
|
|
28
28
|
sparseCloneSkills,
|
|
29
29
|
isGitAvailable,
|
|
30
|
+
isInsideGitWorkTree,
|
|
30
31
|
listCheckedOutSkills,
|
|
31
32
|
updateSparseCheckout,
|
|
32
33
|
sparseCloneSubagents,
|
|
@@ -279,8 +280,14 @@ async function runSkillsInstallForTarget(skills, existingInstalls, target) {
|
|
|
279
280
|
|
|
280
281
|
// Ask about .gitignore (only for fresh installs and if not already in .gitignore)
|
|
281
282
|
let shouldGitignore = false;
|
|
283
|
+
const isInGitWorkTree = isInsideGitWorkTree();
|
|
282
284
|
const gitignorePath = resolveInstallPath('.gitignore');
|
|
283
|
-
if (
|
|
285
|
+
if (
|
|
286
|
+
isInGitWorkTree &&
|
|
287
|
+
!isManageMode &&
|
|
288
|
+
!isHomePath(installPath) &&
|
|
289
|
+
!isInGitignore(gitignorePath, installPath)
|
|
290
|
+
) {
|
|
284
291
|
shouldGitignore = await promptGitignore(installPath);
|
|
285
292
|
}
|
|
286
293
|
|
|
@@ -433,8 +440,14 @@ async function runSubagentsInstallForTarget(subagents, existingInstalls, target)
|
|
|
433
440
|
|
|
434
441
|
// Ask about .gitignore (only for fresh installs and if not already in .gitignore)
|
|
435
442
|
let shouldGitignore = false;
|
|
443
|
+
const isInGitWorkTree = isInsideGitWorkTree();
|
|
436
444
|
const gitignorePath = resolveInstallPath('.gitignore');
|
|
437
|
-
if (
|
|
445
|
+
if (
|
|
446
|
+
isInGitWorkTree &&
|
|
447
|
+
!isManageMode &&
|
|
448
|
+
!isHomePath(installPath) &&
|
|
449
|
+
!isInGitignore(gitignorePath, installPath)
|
|
450
|
+
) {
|
|
438
451
|
shouldGitignore = await promptGitignore(installPath);
|
|
439
452
|
}
|
|
440
453
|
|
package/lib/git.js
CHANGED
|
@@ -28,6 +28,24 @@ export function isGitAvailable() {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
/**
|
|
32
|
+
* Check whether a directory is inside a git work tree
|
|
33
|
+
* @param {string} path - Directory to check
|
|
34
|
+
* @returns {boolean}
|
|
35
|
+
*/
|
|
36
|
+
export function isInsideGitWorkTree(path = process.cwd()) {
|
|
37
|
+
const absolutePath = resolvePath(path);
|
|
38
|
+
try {
|
|
39
|
+
const output = execSync('git rev-parse --is-inside-work-tree', {
|
|
40
|
+
cwd: absolutePath,
|
|
41
|
+
stdio: ['ignore', 'pipe', 'ignore']
|
|
42
|
+
}).toString().trim();
|
|
43
|
+
return output === 'true';
|
|
44
|
+
} catch {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
31
49
|
/**
|
|
32
50
|
* Execute a git command and return the result
|
|
33
51
|
* @param {string[]} args - Git command arguments
|