@hey-api/openapi-ts
Version:
🚀 The OpenAPI to TypeScript codegen. Generate clients, SDKs, validators, and more.
19 lines (15 loc) • 540 B
JavaScript
import { spawnSync } from 'node:child_process';
import fs from 'node:fs';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const target = path.join(__dirname, '..', 'dist', 'run.js');
if (!fs.existsSync(target)) {
console.error('openapi-ts not built (expect dist/run.js)');
process.exit(1);
}
const res = spawnSync(process.execPath, [target, ...process.argv.slice(2)], {
stdio: 'inherit',
});
process.exit(res.status ?? 0);