mirror of
https://github.com/cupcakearmy/autorestic.git
synced 2024-11-17 19:10:02 +01:00
22 lines
608 B
TypeScript
22 lines
608 B
TypeScript
import { exec, spawn } from 'child_process';
|
|
import { config } from './config';
|
|
|
|
|
|
const cmd = 'ts-node-dev';
|
|
const params = `--project .codedoc/tsconfig.json`
|
|
+ ` -T --watch ${config.src.base},.codedoc`
|
|
+ ` --ignore-watch .codedoc/node_modules`
|
|
+ ` .codedoc/serve`;
|
|
|
|
|
|
if (process.platform === 'win32') {
|
|
const child = exec(cmd + ' ' + params);
|
|
|
|
child.stdout?.pipe(process.stdout);
|
|
child.stderr?.pipe(process.stderr);
|
|
child.on('close', () => {});
|
|
}
|
|
else {
|
|
const child = spawn(cmd, [params], { stdio: 'inherit', shell: 'bash' });
|
|
child.on('close', () => {});
|
|
} |