2023-06-15 14:42:27 +00:00
|
|
|
const path = require('node:path');
|
|
|
|
const childProcess = require('node:child_process');
|
2019-02-13 23:24:28 +00:00
|
|
|
|
|
|
|
const typeCheck = () => {
|
2023-02-17 18:56:09 +00:00
|
|
|
const tscExec = path.resolve(require.resolve('typescript'), '../../bin/tsc');
|
2019-02-13 23:24:28 +00:00
|
|
|
const tscChild = childProcess.spawn(process.execPath, [tscExec, '--project', './ts-smoke/tsconfig.json'], {
|
|
|
|
cwd: path.resolve(__dirname, '../')
|
2023-02-17 18:56:09 +00:00
|
|
|
});
|
|
|
|
tscChild.stdout.on('data', d => console.log(d.toString()));
|
|
|
|
tscChild.stderr.on('data', d => console.error(d.toString()));
|
2019-02-13 23:24:28 +00:00
|
|
|
tscChild.on('exit', (tscStatus) => {
|
|
|
|
if (tscStatus !== 0) {
|
2023-02-17 18:56:09 +00:00
|
|
|
process.exit(tscStatus);
|
2019-02-13 23:24:28 +00:00
|
|
|
}
|
2023-02-17 18:56:09 +00:00
|
|
|
});
|
|
|
|
};
|
2019-02-13 23:24:28 +00:00
|
|
|
|
2023-02-17 18:56:09 +00:00
|
|
|
typeCheck();
|