@@ -4,6 +4,7 @@ import * as ts from "typescript";
44import * as tstl from "." ;
55import * as CommandLineParser from "./CommandLineParser" ;
66import * as diagnosticFactories from "./diagnostics" ;
7+ import { normalizeSlashes } from "./utils" ;
78
89function createWatchStatusReporter ( options ?: ts . CompilerOptions ) : ts . WatchStatusReporter {
910 return ( ts as any ) . createWatchStatusReporter ( ts . sys , shouldBePretty ( options ) ) ;
@@ -24,7 +25,7 @@ function locateConfigFile(commandLine: tstl.ParsedCommandLine): string | undefin
2425 const { project } = commandLine . options ;
2526 if ( ! project ) {
2627 if ( commandLine . fileNames . length === 0 ) {
27- const searchPath = path . posix . normalize ( ts . sys . getCurrentDirectory ( ) ) ;
28+ const searchPath = normalizeSlashes ( ts . sys . getCurrentDirectory ( ) ) ;
2829 return ts . findConfigFile ( searchPath , ts . sys . fileExists ) ;
2930 }
3031 return ;
@@ -36,18 +37,13 @@ function locateConfigFile(commandLine: tstl.ParsedCommandLine): string | undefin
3637 return ;
3738 }
3839
39- let fileOrDirectory = path . posix . normalize ( project ) ;
40- if ( ! path . isAbsolute ( fileOrDirectory ) ) {
41- fileOrDirectory = path . posix . join ( ts . sys . getCurrentDirectory ( ) , fileOrDirectory ) ;
42- }
43-
40+ const fileOrDirectory = normalizeSlashes ( path . resolve ( ts . sys . getCurrentDirectory ( ) , project ) ) ;
4441 if ( ! fileOrDirectory || ts . sys . directoryExists ( fileOrDirectory ) ) {
4542 const configFileName = path . posix . join ( fileOrDirectory , "tsconfig.json" ) ;
4643 if ( ts . sys . fileExists ( configFileName ) ) {
4744 return configFileName ;
4845 } else {
4946 reportDiagnostic ( diagnosticFactories . cannotFindATsconfigJsonAtTheSpecifiedDirectory ( project ) ) ;
50-
5147 ts . sys . exit ( ts . ExitStatus . DiagnosticsPresent_OutputsSkipped ) ;
5248 }
5349 } else {
0 commit comments