@danhachuel/thunderbolt 0.5.46 → 0.5.47
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/package.json +1 -1
- package/scripts/install.mjs +4 -0
package/package.json
CHANGED
package/scripts/install.mjs
CHANGED
|
@@ -216,6 +216,8 @@ function legacyNpxPackageRoots() {
|
|
|
216
216
|
|
|
217
217
|
function migrateLegacyNpxStorage() {
|
|
218
218
|
const targetStorage = join(thunderboltHome, "storage");
|
|
219
|
+
const migrationMarker = join(targetStorage, "state", "npx-storage-migration-v1.json");
|
|
220
|
+
if (existsSync(migrationMarker)) return;
|
|
219
221
|
const candidates = legacyNpxPackageRoots();
|
|
220
222
|
let mergedFiles = 0;
|
|
221
223
|
for (const candidate of candidates) {
|
|
@@ -223,6 +225,8 @@ function migrateLegacyNpxStorage() {
|
|
|
223
225
|
mergedFiles += mergeLegacyStorage(candidate);
|
|
224
226
|
}
|
|
225
227
|
if (mergedFiles > 0) console.log(`Dados locais recuperados do cache npm para ${targetStorage} (${mergedFiles} ficheiro(s) unido(s)).`);
|
|
228
|
+
mkdirSync(dirname(migrationMarker), { recursive: true });
|
|
229
|
+
writeFileSync(migrationMarker, JSON.stringify({ version: 1, migrated_at: new Date().toISOString() }) + "\n", "utf8");
|
|
226
230
|
}
|
|
227
231
|
|
|
228
232
|
function copyOrMove(source, target, label) {
|