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