@everystack/cli 0.2.29 → 0.2.30
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/src/cli/commands/update.ts +13 -2
package/package.json
CHANGED
|
@@ -501,9 +501,20 @@ export async function updateCommand(flags: UpdateFlags & Record<string, string>)
|
|
|
501
501
|
'no-cache',
|
|
502
502
|
);
|
|
503
503
|
|
|
504
|
-
// Prune stale fingerprinted files
|
|
504
|
+
// Prune stale fingerprinted files — scoped to configured prefixes only.
|
|
505
|
+
// Skip pruning entirely if any prefix is empty (would list the whole bucket).
|
|
505
506
|
const FINGERPRINT_RE = /-[0-9a-f]{8}\.[^.]+$/;
|
|
506
|
-
const
|
|
507
|
+
const prefixes = [...new Set(assetDirs.map(d => d.to))];
|
|
508
|
+
const allKeys: string[] = [];
|
|
509
|
+
const hasSafePrefix = prefixes.every(p => p.length > 0);
|
|
510
|
+
if (hasSafePrefix) {
|
|
511
|
+
for (const prefix of prefixes) {
|
|
512
|
+
const keys = await listS3(config.region, config.mediaBucket!, prefix);
|
|
513
|
+
allKeys.push(...keys);
|
|
514
|
+
}
|
|
515
|
+
} else {
|
|
516
|
+
warn('Skipping media prune: asset prefix is empty (would list entire bucket).');
|
|
517
|
+
}
|
|
507
518
|
const currentValues = new Set(Object.values(manifestFiles));
|
|
508
519
|
currentValues.add('media-manifest.json');
|
|
509
520
|
const staleKeys = allKeys.filter(key =>
|