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

Use latest TypeScript compiler version automatically #1320

Closed
wants to merge 2 commits into from
Closed

Use latest TypeScript compiler version automatically #1320

wants to merge 2 commits into from

Conversation

alexfoxgill
Copy link

This small feature addresses #1284 by allowing a version wildcard in tryFindFile. When given a path containing the wildcard [v], the algorithm will search the the parent directory for subdirectories matching a regular expression which identifies digits separated by dots (e.g. 1.8)

The TypeScriptCompilerPath has been updated to use the feature:

let private TypeScriptCompilerPath = 
    @"[ProgramFilesX86]\Microsoft SDKs\TypeScript\[v]\;[ProgramFiles]\Microsoft SDKs\TypeScript\[v]\"

I have not written any tests for this method, as it is difficult to mock the filesystem, which the tryFindFile method relies on. Perhaps a configurable proxy module could be created to provide Directory.GetDirectories, Directory.Exists and File.Exists and provide override methods in test code... But I think this is overkill.

@alexfoxgill
Copy link
Author

alexfoxgill commented Jul 21, 2016

I've just seen another PR #1308 which seems to do this too...! The other PR has fewer far-reaching consequences so I'd probably go with that one

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.

1 participant