chore: exclude local resource artifacts from main sync

This commit is contained in:
2026-05-15 10:16:45 +09:00
parent 442879313f
commit d38d022872
504 changed files with 17074 additions and 3642 deletions

View File

@@ -0,0 +1,25 @@
import { existsSync, readdirSync, rmSync } from 'node:fs';
import { basename, join, resolve } from 'node:path';
const cwd = process.cwd();
const outDir = resolve(cwd, process.env.APP_DIST_DIR?.trim() || 'app-dist');
const backupPrefix = 'assets.root-owned-backup-';
if (!existsSync(outDir)) {
process.exit(0);
}
for (const entry of readdirSync(outDir, { withFileTypes: true })) {
if (entry.name.startsWith(backupPrefix)) {
continue;
}
const targetPath = join(outDir, entry.name);
try {
rmSync(targetPath, { recursive: true, force: true });
} catch (error) {
const message = error instanceof Error ? error.message : String(error);
console.warn(`[prepare-app-dist] skipped ${basename(targetPath)}: ${message}`);
}
}