dotnet / dotnet/sdk

Detect and suggest updating dotnet global tools

Open
#42,917 2 comments 1 reaction 0 assignees View on GitHub
Area-Tools untriaged
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

Most CLI tools nowadays notify users of updates that can be installed (i.e. ngrok, gh cli, etc.). In many cases, they can update themselves.

This is currently impossible to achieve from within dotnet global tools, since the tool files are locked while it's running, and therefore a `dotnet update` command fails since it attempts to delete the version being replaced.

Since the `dotnet install` tool can know the originating source for a tool, and there is a built-in API in nuget to check for updates (see [this example of how to show pending updates for a global tool](https://github.com/devlooped/dotnet-retest/blob/main/src/dotnet-retest/Program.cs#L61-L94), it should be in principle possible to remember the source feed location and check for updates periodically (before, during or after) when the tool is used. I currently [run this concurrently in the background while the tool runs](https://github.com/devlooped/dotnet-retest/blob/main/src/dotnet-retest/Program.cs#L50-L57) and show the updates afterwards.

Ideally, dotnet itself would check for updates and offer to update tools.

/cc @baronfel

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.