Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 1m16s
Build & Deploy / 🧪 QA (push) Failing after 1m30s
Build & Deploy / 🏗️ Build (push) Has been skipped
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s
- fixed Sentry NDJSON parsing error in relay endpoint - fully isolated Annotator bundle via next/dynamic (60kb chunk, completely removed from main thread) - aligned images for Kabelleitungsbau & Bohrtechnik across Start and Kompetenzen pages - extended transition fallback timeout for slow dev server cold starts
37 lines
1.0 KiB
TypeScript
37 lines
1.0 KiB
TypeScript
'use server';
|
|
import fs from 'fs';
|
|
import path from 'path';
|
|
|
|
export async function getAnnotatorAssets() {
|
|
// Try /app/public first (docker), then process.cwd()/public
|
|
let publicDir = '/app/public';
|
|
if (!fs.existsSync(publicDir)) {
|
|
publicDir = path.join(process.cwd(), 'public');
|
|
}
|
|
|
|
const walk = async (dir: string): Promise<string[]> => {
|
|
let results: string[] = [];
|
|
if (!fs.existsSync(dir)) return results;
|
|
|
|
const list = await fs.promises.readdir(dir);
|
|
for (const file of list) {
|
|
const filePath = path.join(dir, file);
|
|
const stat = await fs.promises.stat(filePath);
|
|
if (stat && stat.isDirectory()) {
|
|
const nested = await walk(filePath);
|
|
results = results.concat(nested);
|
|
} else {
|
|
if (filePath.match(/\.(png|jpg|jpeg|webp|mp4|svg)$/i)) {
|
|
results.push(filePath.replace(publicDir, ''));
|
|
}
|
|
}
|
|
}
|
|
return results;
|
|
};
|
|
|
|
const results = await walk(publicDir);
|
|
|
|
// Console logs removed for absolute silence & speed
|
|
return results;
|
|
}
|