From 00a373a5ef29904e84c7c4ae026bf551393eac20 Mon Sep 17 00:00:00 2001 From: SaschaNaz Date: Tue, 22 Sep 2015 18:09:54 +0900 Subject: [PATCH] update regex for filename --- src/compiler/diagnosticMessages.json | 2 +- src/compiler/tsc.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 8fbea626eea..6c180921d4f 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2056,7 +2056,7 @@ "category": "Error", "code": 5054 }, - "The project file name is not in 'tsconfig-*.json' format: '{0}'": { + "The project file name is not in 'tsconfig(-*).json' format: '{0}'": { "category": "Error", "code": 5055 }, diff --git a/src/compiler/tsc.ts b/src/compiler/tsc.ts index 3aedd5efd11..67f7ee2aaad 100644 --- a/src/compiler/tsc.ts +++ b/src/compiler/tsc.ts @@ -186,11 +186,11 @@ namespace ts { } let fileOrDirectory = normalizePath(commandLine.options.project); - if (!fileOrDirectory || sys.directoryExists(fileOrDirectory)) { + if (!fileOrDirectory /* current directory */ || sys.directoryExists(fileOrDirectory)) { configFileName = combinePaths(fileOrDirectory, "tsconfig.json"); } else { - if (!/^tsconfig.*\.json$/.test(getBaseFileName(fileOrDirectory))) { + if (!/^tsconfig(?:-.*)?.json$/.test(getBaseFileName(fileOrDirectory))) { reportDiagnostic(createCompilerDiagnostic(Diagnostics.The_project_file_name_is_not_in_tsconfig_Asterisk_json_format_Colon_0, commandLine.options.project)); return sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped); }