Files
resend__react-email/packages/react-email/dev/index.js
2026-04-13 14:29:49 -03:00

47 lines
857 B
JavaScript
Executable File

import child_process from 'node:child_process';
import path from 'node:path';
import url from 'node:url';
import { join } from 'shlex';
const filename = url.fileURLToPath(import.meta.url);
const dirname = path.dirname(filename);
const root = path.resolve(dirname, '../src/cli/index.ts');
const tsx = child_process.spawn(
`pnpm tsx ${root} ${join(process.argv.slice(2))}`,
{
cwd: process.cwd(),
shell: true,
stdio: 'inherit',
},
);
tsx.on('close', (code) => {
process.exit(code);
});
process.on('uncaughtExceptionMonitor', () => {
tsx.kill();
});
process.on('exit', (code) => {
tsx.kill(code);
});
process.on('SIGINT', () => {
tsx.kill('SIGINT');
});
process.on('SIGTERM', () => {
tsx.kill('SIGTERM');
});
process.on('SIGUSR1', () => {
tsx.kill('SIGUSR1');
});
process.on('SIGUSR2', () => {
tsx.kill('SIGUSR2');
});