Skip to content

3671: Create a "SetPaketCommand" target to be able to try Exec the local cli tool - #3672

Merged
forki merged 2 commits into
fsprojects:masterfrom
atlemann:3671-fix.dotnet.global.tool
Sep 29, 2019
Merged

forki merged 2 commits into
fsprojects:masterfrom
atlemann:3671-fix.dotnet.global.tool

Conversation

@atlemann

Copy link
Copy Markdown
Contributor

Suggested by @NatElkins.

Fixes: #3671

able to try Exec local cli tool suggested by @NatElkins.
<PropertyGroup>
<_PaketExeExtension>$([System.IO.Path]::GetExtension("$(PaketExePath)"))</_PaketExeExtension>
<InternalPaketCommand Condition=" '$(InternalPaketCommand)' == '' AND '$(_PaketExeExtension)' == '.dll' ">dotnet "$(PaketExePath)"</InternalPaketCommand>
<InternalPaketCommand Condition=" '$(InternalPaketCommand)' == '' AND '$(_PaketExeExtension)' == '' AND $(LocalPaketToolExitCode) == 0">dotnet "$(PaketExePath)"</InternalPaketCommand>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I guess we could start with checking if LocalPaketToolExitCode == 0 and if it is, just set InternalPaketCommand to dotnet paket? @NatElkins

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sure whatever you think is clearest to someone coming back a year from now to try and decipher this.

command into 'SetPaketCommand' target.
- If exitcode = 0 then set local tool, if not search as before.
@atlemann

Copy link
Copy Markdown
Contributor Author

We could consider this way instead as mentioned in the issue:

<PropertyGroup>
  <DotnetToolsJson>($([System.IO.File]::ReadAllText("$(PaketRootPath)/.config/dotnet-tools.json")))</DotnetToolsJson>
  <ContainsPaket>$(DotnetToolsJson.Contains('"paket"'))</ContainsPaket>
</PropertyGroup>

@forki

forki commented Sep 29, 2019

Copy link
Copy Markdown
Member

Oh CI is red?

@atlemann

Copy link
Copy Markdown
Contributor Author

Yes, couldn't see why.

@forki forki closed this Sep 29, 2019
@forki forki reopened this Sep 29, 2019
@forki

forki commented Sep 29, 2019

Copy link
Copy Markdown
Member

Let's rerun this

@atlemann

Copy link
Copy Markdown
Contributor Author

Ok, the first commit passed and I only moved the paketexe search stuff into the target in the second one to avoid doing that work if not used. But maybe I missed a usage somewhere.

@atlemann

Copy link
Copy Markdown
Contributor Author

Passed now

@forki
forki merged commit 5dbdc1e into fsprojects:master Sep 29, 2019
@forki

forki commented Sep 29, 2019

Copy link
Copy Markdown
Member

Thanks so much for the help!

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.

dotnet restore does not work on Linux when installed as global tool

3 participants