Skip to content

Commit

Permalink
fix (#1620)
Browse files Browse the repository at this point in the history
  • Loading branch information
cspotcode committed Feb 2, 2022
1 parent 5284051 commit 6e48ef2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/bin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -1340,6 +1342,7 @@ export function create(rawOptions: CreateOptions = {}): Service {
return {
[TS_NODE_SERVICE_BRAND]: true,
ts,
compilerPath: compiler,
config,
compile,
getTypeInfo,
Expand Down

0 comments on commit 6e48ef2

Please sign in to comment.