diff options
| author | Akshay Nair <phenax5@gmail.com> | 2023-01-14 13:22:39 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2023-01-14 13:22:39 +0530 |
| commit | d362ef26db894ea52c6abd34489aa9efdbc0c89b (patch) | |
| tree | 20400ad5ebc70085447e2bb087381aa8c8409afd /src/index.ts | |
| parent | 4746652abfb7aed46627d27a55919d2986885735 (diff) | |
| download | ts-types-lang-d362ef26db894ea52c6abd34489aa9efdbc0c89b.tar.gz ts-types-lang-d362ef26db894ea52c6abd34489aa9efdbc0c89b.zip | |
chore: adds test cases + fixes Test effect scope
Diffstat (limited to 'src/index.ts')
| -rw-r--r-- | src/index.ts | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/index.ts b/src/index.ts index f6d46d6..4775823 100644 --- a/src/index.ts +++ b/src/index.ts @@ -15,12 +15,17 @@ const main = () => { .description('Run a typescript .ts file') .argument('<file>', 'Typescript file to run') .action(async (filePath) => { - const ctx = createContext({ filePath }) - const resultType = ctx.entryPoint.getType() - const effects = resultType.isTuple() - ? resultType.getTupleElements() - : [resultType] - await evalList(ctx, effects) + try { + const ctx = createContext({ filePath }) + const resultType = ctx.entryPoint.getType() + const effects = resultType.isTuple() + ? resultType.getTupleElements() + : [resultType] + await evalList(ctx, effects) + } catch (e) { + console.error(e) + process.exit(1) + } }) return program.parseAsync() |
