Skip to content
This repository was archived by the owner on Mar 1, 2021. It is now read-only.

If version is specified it should check version and uninstall if differs #2

Closed
devlead opened this issue Dec 30, 2018 · 0 comments
Closed
Milestone

Comments

@devlead
Copy link
Member

devlead commented Dec 30, 2018

Currently if I change
#tool "dotnet:https://api.nuget.org/v3/index.json?package=GitVersion.Tool&version=4.0.1-beta1-53"
to
#tool "dotnet:https://api.nuget.org/v3/index.json?package=GitVersion.Tool&version=4.0.1-beta1-58"

It won't use the new version, and that's not what's expected when pinning a version.

Directory structure is

tools\.store\gitversion.tool\{version}

So if differs one should be able to run
dotnet tool uninstall --tool-path .\tools\ GitVersion.Tool and then install.

dotnet tool uninstall --tool-path .\tools\ GitVersion.Tool 
+ Tool 'gitversion.tool' (version '4.0.1-beta1-53') was successfully uninstalled.

dotnet tool install --tool-path .\tools\ --version="4.0.1-beta1-58" GitVersion.Tool
+ You can invoke the tool using the following command: dotnet-gitversion
+ Tool 'gitversion.tool' (version '4.0.1-beta1-58') was successfully installed.

Code for reference:

if(installedToolNames.Contains(package.Package.ToLowerInvariant()))
{
_log.Information("Tool {0} is already installed, so nothing to do here.", package.Package);
}

@gep13 gep13 added this to the 0.4.0 milestone Nov 25, 2019
gep13 added a commit that referenced this issue Nov 25, 2019
Previously, the Module wouldn't check to see what version of a Tool was
installed.  As a result, when a tool was already installed, even if a
newer version was requested, it wouldn't be installed.  This is really
down to the underlying tool and how it works, but smarts have now been
put into the module, to check installed version, against what is
requested, so that an uninstall is first executed, and then the requested
version is installed.
@gep13 gep13 closed this as completed Nov 25, 2019
devlead pushed a commit to devlead/cake that referenced this issue Feb 27, 2021
…ool version

Previously, the Module wouldn't check to see what version of a Tool was
installed.  As a result, when a tool was already installed, even if a
newer version was requested, it wouldn't be installed.  This is really
down to the underlying tool and how it works, but smarts have now been
put into the module, to check installed version, against what is
requested, so that an uninstall is first executed, and then the requested
version is installed.
augustoproiete pushed a commit to devlead/cake that referenced this issue Feb 27, 2021
…ool version

Previously, the Module wouldn't check to see what version of a Tool was
installed.  As a result, when a tool was already installed, even if a
newer version was requested, it wouldn't be installed.  This is really
down to the underlying tool and how it works, but smarts have now been
put into the module, to check installed version, against what is
requested, so that an uninstall is first executed, and then the requested
version is installed.
devlead pushed a commit to devlead/cake that referenced this issue Feb 27, 2021
…ool version

Previously, the Module wouldn't check to see what version of a Tool was
installed.  As a result, when a tool was already installed, even if a
newer version was requested, it wouldn't be installed.  This is really
down to the underlying tool and how it works, but smarts have now been
put into the module, to check installed version, against what is
requested, so that an uninstall is first executed, and then the requested
version is installed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants