mirror of
https://github.com/elder-plinius/G0DM0D3.git
synced 2026-11-16 07:02:25 +00:00
fix: handle missing archive/legacy dir on first compaction run
listAllFiles('archive/legacy') throws 404 EntryNotFound when the
directory doesn't exist yet on HF. Catch it so the first run
proceeds instead of dying at Step 2.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -146,7 +146,12 @@ async function main() {
|
||||
console.log(`Step 2: Checking for existing manifest (run ID: ${currentRunId})...`);
|
||||
|
||||
// Also check if a DIFFERENT run's manifest exists (partial deletion scenario)
|
||||
const archiveLegacyEntries = await listAllFiles('archive/legacy', true);
|
||||
let archiveLegacyEntries = [];
|
||||
try {
|
||||
archiveLegacyEntries = await listAllFiles('archive/legacy', true);
|
||||
} catch (err) {
|
||||
if (!/404|EntryNotFound|does not exist/i.test(String(err.message))) throw err;
|
||||
}
|
||||
const existingManifests = archiveLegacyEntries.filter(
|
||||
f => f.type === 'file' && f.path.endsWith('/manifest.json')
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user