@wipcomputer/wip-ldm-os 0.4.22 → 0.4.24
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/SKILL.md +1 -1
- package/lib/deploy.mjs +32 -1
- package/package.json +1 -1
package/SKILL.md
CHANGED
package/lib/deploy.mjs
CHANGED
|
@@ -683,7 +683,38 @@ export function installSingleTool(toolPath) {
|
|
|
683
683
|
|
|
684
684
|
if (ifaceNames.length === 0) return 0;
|
|
685
685
|
|
|
686
|
-
|
|
686
|
+
// Derive tool name from package.json, never from /tmp/ clone path
|
|
687
|
+
let toolName = pkg?.name?.replace(/^@\w+\//, '') || basename(toolPath);
|
|
688
|
+
// Strip ldm-install- prefix if it leaked from clone path
|
|
689
|
+
toolName = toolName.replace(/^ldm-install-/, '');
|
|
690
|
+
|
|
691
|
+
// Migrate ldm-install-* ghost directories (#96)
|
|
692
|
+
// Old installs used /tmp/ldm-install-<name> as source, which leaked into the directory name.
|
|
693
|
+
// If both ldm-install-<name> and <name> exist, remove the ghost and clean the registry.
|
|
694
|
+
const ghostName = `ldm-install-${toolName}`;
|
|
695
|
+
const ghostPath = join(LDM_EXTENSIONS, ghostName);
|
|
696
|
+
if (existsSync(ghostPath) && ghostName !== toolName) {
|
|
697
|
+
if (!DRY_RUN) {
|
|
698
|
+
const trashDir = join(LDM_ROOT, '_trash', new Date().toISOString().split('T')[0]);
|
|
699
|
+
try {
|
|
700
|
+
mkdirSync(trashDir, { recursive: true });
|
|
701
|
+
const trashDest = join(trashDir, ghostName);
|
|
702
|
+
cpSync(ghostPath, trashDest, { recursive: true });
|
|
703
|
+
execSync(`rm -rf "${ghostPath}"`, { stdio: 'pipe' });
|
|
704
|
+
// Clean registry
|
|
705
|
+
const registry = loadRegistry();
|
|
706
|
+
if (registry.extensions?.[ghostName]) {
|
|
707
|
+
delete registry.extensions[ghostName];
|
|
708
|
+
saveRegistry(registry);
|
|
709
|
+
}
|
|
710
|
+
log(`Migrated ghost directory: ${ghostName} -> _trash/ (real name: ${toolName})`);
|
|
711
|
+
} catch (e) {
|
|
712
|
+
log(`Warning: could not migrate ${ghostName}: ${e.message}`);
|
|
713
|
+
}
|
|
714
|
+
} else {
|
|
715
|
+
log(`Would migrate ghost directory: ${ghostName} -> _trash/ (real name: ${toolName})`);
|
|
716
|
+
}
|
|
717
|
+
}
|
|
687
718
|
|
|
688
719
|
if (!JSON_OUTPUT) {
|
|
689
720
|
console.log('');
|