From 6e48ef27fcaa0b2d0e9edbc3c7edc1d20a1828e3 Mon Sep 17 00:00:00 2001 From: Andrew Bradley Date: Tue, 1 Feb 2022 20:39:36 -0500 Subject: [PATCH] fix (#1620) --- src/bin.ts | 10 +++++++++- src/index.ts | 3 +++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/bin.ts b/src/bin.ts index 564ddaba3..c1a02be72 100644 --- a/src/bin.ts +++ b/src/bin.ts @@ -312,12 +312,20 @@ Options: stdinStuff?.repl.setService(service); // Output project information. - if (version >= 2) { + if (version === 2) { console.log(`ts-node v${VERSION}`); console.log(`node ${process.version}`); console.log(`compiler v${service.ts.version}`); process.exit(0); } + if (version >= 3) { + console.log(`ts-node v${VERSION} ${dirname(__dirname)}`); + console.log(`node ${process.version}`); + console.log( + `compiler v${service.ts.version} ${service.compilerPath ?? ''}` + ); + process.exit(0); + } if (showConfig) { const ts = service.ts as any as TSInternal; diff --git a/src/index.ts b/src/index.ts index 17aed8998..ee542e733 100644 --- a/src/index.ts +++ b/src/index.ts @@ -477,6 +477,8 @@ export interface Service { /** @internal */ [TS_NODE_SERVICE_BRAND]: true; ts: TSCommon; + /** @internal */ + compilerPath: string; config: _ts.ParsedCommandLine; options: RegisterOptions; enabled(enabled?: boolean): boolean; @@ -1340,6 +1342,7 @@ export function create(rawOptions: CreateOptions = {}): Service { return { [TS_NODE_SERVICE_BRAND]: true, ts, + compilerPath: compiler, config, compile, getTypeInfo,