@maccesar/titools 4.16.1 → 4.16.3
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/lib/downloader.js +1 -0
- package/lib/installer.js +7 -0
- package/package.json +1 -1
package/lib/downloader.js
CHANGED
package/lib/installer.js
CHANGED
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
getClaudeCommandsDir,
|
|
21
21
|
} from './config.js';
|
|
22
22
|
import { removeSkills, removeAgents, removeCommands } from './cleanup.js';
|
|
23
|
+
import { createSymlinkOrCopy } from './symlink.js';
|
|
23
24
|
|
|
24
25
|
/**
|
|
25
26
|
* Recursively copy a directory
|
|
@@ -42,6 +43,8 @@ export async function copyDirectory(src, dest) {
|
|
|
42
43
|
* @param {string} repoDir - Repository directory
|
|
43
44
|
* @param {string} skillName - Name of the skill
|
|
44
45
|
* @param {string} baseDir - Base directory for installation
|
|
46
|
+
* Development checkouts are linked so `npm link` users see edits immediately.
|
|
47
|
+
* Published npm packages are copied so installed skills remain independent.
|
|
45
48
|
* @returns {Promise<boolean>} True if installed successfully
|
|
46
49
|
*/
|
|
47
50
|
export async function installSkill(repoDir, skillName, baseDir = os.homedir()) {
|
|
@@ -59,6 +62,10 @@ export async function installSkill(repoDir, skillName, baseDir = os.homedir()) {
|
|
|
59
62
|
return false;
|
|
60
63
|
}
|
|
61
64
|
|
|
65
|
+
if (existsSync(join(repoDir, '.git'))) {
|
|
66
|
+
return createSymlinkOrCopy(skillSrc, skillDest, true);
|
|
67
|
+
}
|
|
68
|
+
|
|
62
69
|
// Remove existing if present
|
|
63
70
|
if (existsSync(skillDest)) {
|
|
64
71
|
await remove(skillDest);
|