fsprojects / FAKE

FAKE - F# Make
https://fake.build
Other
1.28k stars 582 forks source link

Why `version` must be present in `global.json` if you don't require it #2756

Closed xperiandri closed 9 months ago

xperiandri commented 11 months ago

Description

When version is absent in global.json call fails at this line https://github.com/fsprojects/FAKE/blob/13e30330cae0597aed6154a95a06d21716b18de3/src/app/Fake.DotNet.Cli/DotNet.fs#L69

Repro steps

  1. Create global.json without version
  2. Execute DotNet.restore id <path>

Expected behavior

No exception happens. More over current exception is not descriptive at all!

Actual behavior

NullReferenceException

Known workarounds

No

Related information

I'm ready to create a PR if you approve this behavior change

github-actions[bot] commented 11 months ago

Welcome to the FAKE community! Thank you so much for creating your first issue and therefore improving the project!

baronfel commented 11 months ago

Totally agree here - if there's no version this function should return None. Definitely send a PR! (He said, despite not being a maintainer)