Skip to content
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

Add support for taking relative CLI args and using them as absolute internally #32992

Closed
wants to merge 4 commits into from

Conversation

orta
Copy link
Contributor

@orta orta commented Aug 20, 2019

Fixes #30457

The idea here is that after parseCommandLineWorker has done its work and before it is used for compilation - any relative paths are re-defined as absolute when the CLI options are merged with a tsconfig. Making the example issues in #30457 pass.

@orta orta requested a review from sheetalkamat August 20, 2019 17:32
src/compiler/commandLineParser.ts Outdated Show resolved Hide resolved
src/tsc/tsc.ts Outdated Show resolved Hide resolved
@orta orta self-assigned this Sep 16, 2019
@orta
Copy link
Contributor Author

orta commented Sep 16, 2019

OK @sheetalkamat - I think I've got your feedback covered, sorry for the delay!

@@ -2541,7 +2542,16 @@ namespace ts {
for (const id in jsonOptions) {
const opt = optionNameMap.get(id);
if (opt) {
defaultOptions[opt.name] = convertJsonOption(opt, jsonOptions[id], basePath, errors);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is incorrect... You want do want to use convertJsonOption as was earlier here and combine the basePath with the nonrooted Paths as this is an API entry point and you cannot use sys.getCurrentDirectory() here..

The suggestedChange I recommended was to call convertOptionsFromJson with basePath as sys.getCurrentDirectory()

@orta
Copy link
Contributor Author

orta commented Oct 15, 2019

Deprecated by #34403

@orta orta closed this Oct 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tsc v3.4RC: Incremental build fails when --rootDir passed on CLI
2 participants