mirror of
https://github.com/aljazceru/claude-code-viewer.git
synced 2026-01-28 18:04:25 +01:00
41 lines
1.1 KiB
TypeScript
41 lines
1.1 KiB
TypeScript
import { execSync } from "node:child_process";
|
|
import { dirname, resolve } from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
const __dirname = dirname(__filename);
|
|
|
|
const scripts = [
|
|
"home.ts",
|
|
"projects.ts",
|
|
"project-detail.ts",
|
|
"session-detail.ts",
|
|
"error-pages.ts",
|
|
];
|
|
|
|
async function captureAllSnapshots() {
|
|
console.log("🚀 Starting screenshot capture for all pages...\n");
|
|
|
|
for (const script of scripts) {
|
|
const scriptPath = resolve(__dirname, script);
|
|
console.log(`📸 Capturing: ${script.replace(".ts", "")}...`);
|
|
|
|
try {
|
|
// Execute each script using tsx
|
|
execSync(`npx tsx "${scriptPath}"`, {
|
|
stdio: "inherit",
|
|
cwd: resolve(__dirname, "..", ".."),
|
|
});
|
|
console.log(`✅ Completed: ${script.replace(".ts", "")}\n`);
|
|
} catch (error) {
|
|
console.error(
|
|
`❌ Failed: ${script.replace(".ts", "")} - ${error.message}\n`,
|
|
);
|
|
}
|
|
}
|
|
|
|
console.log("🎉 All screenshot captures completed!");
|
|
}
|
|
|
|
captureAllSnapshots().catch(console.error);
|