Installing global tools on OSX fails - wrong executable name
Steps to reproduce
- from terminal execute the following:
dotnet tool install -g dotnetsay
The command prints: You can invoke the tool using the following command: dotnetsay Tool 'dotnetsay' (version '2.1.4') was successfully installed.
- then execute:
dotnet dotnetsay hi
Expected behavior
The text: "hi" followed by some ascii art
Actual behavior
This text is produced: No executable found matching command "dotnet-dotnetsay"
Environment data
.NET Core SDK (reflecting any global.json): Version: 2.1.403 Commit: 04e15494b6
Runtime Environment: OS Name: Mac OS X OS Version: 10.13 OS Platform: Darwin RID: osx.10.13-x64 Base Path: /usr/local/share/dotnet/sdk/2.1.403/
Host (useful for support): Version: 2.1.5 Commit: 290303f510
.NET Core SDKs installed: 2.1.3 [/usr/local/share/dotnet/sdk] 2.1.4 [/usr/local/share/dotnet/sdk] 2.1.300 [/usr/local/share/dotnet/sdk] 2.1.302 [/usr/local/share/dotnet/sdk] 2.1.401 [/usr/local/share/dotnet/sdk] 2.1.403 [/usr/local/share/dotnet/sdk]
.NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 1.0.9 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Additional info:
I have noted that after i do:
dotnet tool install -g dotnetsay
Then there will be an executable file in ~/.dotnet/tools named: dotnetsay
Executing this file directly as shown below produce the expected result.
.dotnet/tools/dotnetsay hi
Renaming ~/.dotnet/tools/dotnetsay to ~/.dotnet/tools/dotnet-dotnetsay is a work-around, but will need to be done for every tool I install.
I have to add the full path of ~/.dotnet/tools/ to my PATH for it to work at all as described in issue #8589
You installed dotnetsay as a global tool and its executable name is dotnetsay, therefore, you need to invoke it using just dotnetsay and not dotnet dotnetsay.
If you want a tool to be global and invocable through dotnet toolname, said toolname must have its executable as dotnet-toolname.