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

expand typescript search paths on windows to cover all new typescript… #1308

Merged
merged 2 commits into from
Jul 26, 2016

Conversation

baronfel
Copy link
Contributor

… compilers, prefering most recent.

On my machine this returns the following list:

val it : string list =
["C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.8";
"C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.5";
"C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0"]

choosing tsc.exe from 1.8 at the end. there may be underlying issues with ordering, but this is more future-proof than the current implementation.

This fixes #1284

@@ -40,8 +40,7 @@ type TypeScriptParams =
/// Specifies the timeout for the TypeScript compiler.
TimeOut : TimeSpan }

let private TypeScriptCompilerPath =
@"[ProgramFilesX86]\Microsoft SDKs\TypeScript\1.0\;[ProgramFiles]\Microsoft SDKs\TypeScript\1.0\;[ProgramFilesX86]\Microsoft SDKs\TypeScript\0.9\;[ProgramFiles]\Microsoft SDKs\TypeScript\0.9\"
Copy link
Member

Choose a reason for hiding this comment

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

this is gone completely? is it backwards compatible?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Instead of explicitly hard-coding the versions we support by default (1.0, 0.9 currently), the new code discovers what versions the user has installed and uses the latest they have. This could invisibly upgrade some users to a more recent version of tsc, yes, but if they are dependent on a particular version of tsc we should encourage them to set their tools path.

|> List.map (fun p -> p </> TypeScriptCompilerPrefix)
|> List.collect (fun p -> try System.IO.DirectoryInfo(p).GetDirectories() |> List.ofArray with | _ -> [])
|> List.map (fun di -> di.FullName)
|> List.sortDescending

Choose a reason for hiding this comment

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

Sorting by name will only work for single-digit versions - this will pick 9.0 over 10.0 for example

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I was going to address that this morning, commits incoming :)

@forki
Copy link
Member

forki commented Jul 21, 2016

let me know when things are ready. thx

@baronfel
Copy link
Contributor Author

Alright, version checks are in and this should be good to go.

@baronfel
Copy link
Contributor Author

@forki this is ready to go.

@forki forki merged commit fbddace into fsprojects:master Jul 26, 2016
@forki
Copy link
Member

forki commented Jul 26, 2016

thx

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.

3 participants