aboutsummaryrefslogtreecommitdiff
path: root/src/index.ts
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2023-01-14 13:22:39 +0530
committerAkshay Nair <phenax5@gmail.com>2023-01-14 13:22:39 +0530
commitd362ef26db894ea52c6abd34489aa9efdbc0c89b (patch)
tree20400ad5ebc70085447e2bb087381aa8c8409afd /src/index.ts
parent4746652abfb7aed46627d27a55919d2986885735 (diff)
downloadts-types-lang-d362ef26db894ea52c6abd34489aa9efdbc0c89b.tar.gz
ts-types-lang-d362ef26db894ea52c6abd34489aa9efdbc0c89b.zip
chore: adds test cases + fixes Test effect scope
Diffstat (limited to '')
-rw-r--r--src/index.ts17
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()