-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support full path for -project/-p paramater #4883
Changes from 8 commits
62df49f
2710030
04d73ba
00a373a
c850919
d0a20c7
c29501f
8ca6b31
0448eeb
d87fc8b
e5587fb
880db38
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -180,11 +180,26 @@ namespace ts { | |
reportDiagnostic(createCompilerDiagnostic(Diagnostics.The_current_host_does_not_support_the_0_option, "--project")); | ||
return sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped); | ||
} | ||
configFileName = normalizePath(combinePaths(commandLine.options.project, "tsconfig.json")); | ||
if (commandLine.fileNames.length !== 0) { | ||
reportDiagnostic(createCompilerDiagnostic(Diagnostics.Option_project_cannot_be_mixed_with_source_files_on_a_command_line)); | ||
return sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped); | ||
} | ||
|
||
let fileOrDirectory = normalizePath(commandLine.options.project); | ||
if (!fileOrDirectory /* current directory */ || sys.directoryExists(fileOrDirectory)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The comment doesn't quite seem applicable There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is because |
||
configFileName = combinePaths(fileOrDirectory, "tsconfig.json"); | ||
} | ||
else { | ||
if (!/^tsconfig(?:-.*)?\.json$/.test(getBaseFileName(fileOrDirectory))) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not convinced we should limit this to |
||
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); | ||
} | ||
configFileName = fileOrDirectory; | ||
} | ||
if (!sys.fileExists(configFileName)) { | ||
reportDiagnostic(createCompilerDiagnostic(Diagnostics.Cannot_find_any_project_file_in_specified_path_Colon_0, commandLine.options.project)); | ||
return sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped); | ||
} | ||
} | ||
else if (commandLine.fileNames.length === 0 && isJSONSupported()) { | ||
let searchPath = normalizePath(sys.getCurrentDirectory()); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make this
const