Skip to content

Commit a20f202

Browse files
authored
Merge pull request dotnet-script#241 from filipw/feature/global-tool
Feature/global tool
2 parents e7e23b2 + 933c0b1 commit a20f202

File tree

4 files changed

+19
-5
lines changed

4 files changed

+19
-5
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,20 @@ docker run -it dotnet-script --version
5959

6060
You can manually download all the releases in `zip` format from the [Github releases page](https://github.com/filipw/dotnet-script/releases).
6161

62+
### .Net Core Global Tool
63+
64+
.Net Core 2.1 introduces the concept of global tools meaning that we can install `dotnet-script` using nothing but the `dotnet CLI`
65+
66+
```shell
67+
dotnet install tool -g dotnet-script
68+
```
69+
70+
The advantage of this approach is that we will execute the same command for installation across all platforms.
71+
72+
> In order to use the global tool we need at least [.Net Core SDK 2.1.300 preview1](https://www.microsoft.com/net/download/dotnet-core/sdk-2.1.300-preview1)
73+
74+
75+
6276
## Usage
6377

6478
Our typical `helloworld.csx` might look like this

build/Build.csx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#! "netcoreapp2.0"
2-
#load "nuget:Dotnet.Build, 0.2.8"
2+
#load "nuget:Dotnet.Build, 0.2.9"
33
#load "nuget:github-changelog, 0.1.4"
44
#load "Choco.csx"
55
#load "BuildContext.csx"
@@ -15,14 +15,14 @@ DotNet.Publish(DotnetScriptProjectFolder, PublishArtifactsFolder);
1515
// We only publish packages from Windows/AppVeyor
1616
if (BuildEnvironment.IsWindows)
1717
{
18+
NuGet.PackAsTool(DotnetScriptProjectFolder,PublishArtifactsFolder,NuGetArtifactsFolder);
1819
DotNet.Pack(DotnetScriptProjectFolder, NuGetArtifactsFolder);
1920
DotNet.Pack(DotnetScriptCoreProjectFolder, NuGetArtifactsFolder);
2021
DotNet.Pack(DotnetScriptDependencyModelProjectFolder, NuGetArtifactsFolder);
2122
DotNet.Pack(DotnetScriptDependencyModelNuGetProjectFolder, NuGetArtifactsFolder);
2223
Choco.Pack(DotnetScriptProjectFolder, PublishArtifactsFolder, ChocolateyArtifactsFolder);
2324
Zip(PublishArchiveFolder, PathToGitHubReleaseAsset);
24-
25-
25+
2626
if (BuildEnvironment.IsSecure)
2727
{
2828
await CreateReleaseNotes();

build/BuildContext.csx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#load "nuget:Dotnet.Build, 0.2.8"
1+
#load "nuget:Dotnet.Build, 0.2.9"
22
using static FileUtils;
33
using System.Xml.Linq;
44

build/Choco.csx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#load "nuget:Dotnet.Build, 0.2.5"
1+
#load "nuget:Dotnet.Build, 0.2.9"
22

33
using System.Xml.Linq;
44

0 commit comments

Comments
 (0)