Skip to content

dotnet-labs/NETCoreGlobalTools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

.NET Core Global Tools

This blog post discussed CLI tools. It contains a step-by-step guide of creating a custom .NET Core global tool.

Build this project Locally

You can build this project locally either using Docker or using .NET CLI tools.

1. using Docker with Linux containers

global tool in docker

docker build -t global-tool-test .
docker run -it global-tool-test bash
root@7a5df30fefaa:/src/tools# ./stat sd -n 1 2 3
Population Standard Deviation: 0.816496580927726
    Sample Standard Deviation: 1
root@7a5df30fefaa:/src/tools# ./stat avg -n 1 2 3
Arithmetic Average: 2
root@7a5df30fefaa:/src/tools# exit
# can rebuild the project using bash commands in the container

2. using dotnet cli

cd StatisticsToolbox
dotnet pack
dotnet tool install --add-source .nuget\ stat --tool-path .\tools
dotnet tool update --add-source .nuget\ stat --tool-path .\tools
.\tools\stat.exe avg  -n 1
.\tools\stat.exe sd  -n 1 2 3