-
Notifications
You must be signed in to change notification settings - Fork 586
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
GetDotNetSDKVersionFromGlobalJson #1754
Conversation
How will this handle the (pretty common) case when no |
@tlycken I guess you check if the file exists before using this new API? Or you assume the file is there when using the API? |
Ah, yeah, that works. But if so, it would probably be more usable if it returned an Also, should this traverse parent directories? According to the docs, valid locations are the current directory or any ancestor directory up to the drive root. |
I was told by the dotnet cli folks that it is good practice to have that
global.json file. But yes it should only be used in projects that actually
use global.json
Am 03.01.2018 17:59 schrieb "Tomas Lycken" <[email protected]>:
… Ah, yeah, that works. But if so, it would probably be more usable if it
returned an option with the version (if a global.json was found, and None
if it wasn't) rather than failing. That way one could call this, and
provide a fallback (e.g. a hard-coded value) if no global.json is found.
Also, should this traverse parent directories? According to the docs
<https://docs.microsoft.com/en-us/dotnet/core/tools/global-json>, valid
locations are the current directory or any ancestor directory up to the
drive root.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1754 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AADgNPRs1hTHwdxoSba-1JNL9GZyNuV2ks5tG7HogaJpZM4RR9NA>
.
|
The Even though pinning it is probably a good idea as soon as a project is moderately sized with a team of more than one, i think FAKE should support not having one, with a nice and simple API, since otherwise we're imposing arbitrary requirements on your |
@tlycken Yes, however an API called I feel like either people want to lock down the version and have an error if non is given (this API) or they don't. |
@matthid I guess what I'm after is an api that lets me figure out which dotnet version to install, that would respect global.json if it exists, but not blow up if it doesn't (rather figure out which is the latest, and return that). But you're right; that would probably be better to implement with the help of this function, rather than as part of it. |
@tlycken Yes everything is a mess - feel free to suggest an API for this via PR ;) |
No description provided.