mirror of
https://github.com/jackwener/OpenCLI.git
synced 2026-09-14 18:25:42 +08:00
68840fc85c
- Split browser.ts (700 lines) into src/browser/ module (page, mcp, errors, discover, tabs, index) - Add unified error handling: CliError base class + logger module - Enable TypeScript strict mode, fix 12 type errors - Extract inline build scripts to scripts/clean-yaml.cjs and copy-yaml.cjs - All 178 unit tests pass, build produces 83 entries across 19 sites
22 lines
561 B
JavaScript
22 lines
561 B
JavaScript
/**
|
|
* Copy YAML files from src/clis/ to dist/clis/.
|
|
*/
|
|
const { readdirSync, copyFileSync, mkdirSync, existsSync, statSync } = require('fs');
|
|
const path = require('path');
|
|
|
|
function walk(src, dst) {
|
|
if (!existsSync(src)) return;
|
|
for (const f of readdirSync(src)) {
|
|
const sp = path.join(src, f);
|
|
const dp = path.join(dst, f);
|
|
if (statSync(sp).isDirectory()) {
|
|
walk(sp, dp);
|
|
} else if (/\.ya?ml$/.test(f)) {
|
|
mkdirSync(path.dirname(dp), { recursive: true });
|
|
copyFileSync(sp, dp);
|
|
}
|
|
}
|
|
}
|
|
|
|
walk('src/clis', 'dist/clis');
|