From 685b24b3947fcfab0e8ec423711826dd11e3f9ec Mon Sep 17 00:00:00 2001 From: Wout Mertens Date: Sat, 5 Nov 2022 10:06:59 +0100 Subject: [PATCH] fix tsc exec and expose errors --- lib/index.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/index.js b/lib/index.js index f606859..3338675 100755 --- a/lib/index.js +++ b/lib/index.js @@ -41,11 +41,8 @@ const tmpTsconfig = { fs.writeFileSync(tmpTsconfigPath, JSON.stringify(tmpTsconfig, null, 2)) // Type-check our files -const { status } = spawnSync( - resolveFromModule( - 'typescript', - `../.bin/tsc${process.platform === 'win32' ? '.cmd' : ''}`, - ), +const { status, error } = spawnSync( + 'tsc', ['-p', tmpTsconfigPath, ...remainingArgsToForward], { stdio: 'inherit' }, ) @@ -53,4 +50,6 @@ const { status } = spawnSync( // Delete temp config file fs.unlinkSync(tmpTsconfigPath) +if (error) throw error + process.exit(status)