8000 Merge pull request #486 from filipw/fix-choco-build · badbort/dotnet-script@9d81852 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9d81852

Browse files
authored
Merge pull request dotnet-script#486 from filipw/fix-choco-build
Fixedd Chocolatey build
2 parents 687f15f + 91c4716 commit 9d81852

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

build/Build.csx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#load "nuget:Dotnet.Build, 0.3.9"
1+
#load "nuget:Dotnet.Build, 0.7.1"
22
#load "nuget:dotnet-steps, 0.0.1"
33
#load "nuget:github-changelog, 0.1.5"
44
#load "Choco.csx"
@@ -100,7 +100,7 @@ private async Task PublishRelease()
100100

101101
if (Git.Default.IsTagCommit())
102102
{
103-
Git.Default.RequreCleanWorkingTree();
103+
Git.Default.RequireCleanWorkingTree();
104104
await ReleaseManagerFor(owner, projectName, BuildEnvironment.GitHubAccessToken)
105105
.CreateRelease(Git.Default.GetLatestTag(), pathToReleaseNotes, new[] { new ZipReleaseAsset(pathToGitHubReleaseAsset) });
106106
NuGet.TryPush(nuGetArtifactsFolder);

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.3.9"
1+
#load "nuget:Dotnet.Build, 0.7.1"
22
using static FileUtils;
33
using System.Xml.Linq< 8000 /span>;
44

build/Choco.csx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#load "nuget:Dotnet.Build, 0.3.1"
1+
#load "nuget:Dotnet.Build, 0.7.1"
22

33
using System.Xml.Linq;
44

@@ -11,7 +11,6 @@ public static class Choco
1111
/// <param name="outputFolder">The path to the output folder (*.nupkg)</param>
1212
public static void Pack(string pathToProjectFolder, string pathToBinaries, string outputFolder)
1313
{
14-
File.Copy(Path.Combine(pathToProjectFolder, "../../LICENSE"), Path.Combine("Chocolatey","tools","LICENSE.TXT"), true);
1514
string pathToProjectFile = Directory.GetFiles(pathToProjectFolder, "*.csproj").Single();
1615
CreateSpecificationFromProject(pathToProjectFile, pathToBinaries);
1716
Command.Execute("choco.exe", $@"pack Chocolatey\chocolatey.nuspec --outputdirectory {outputFolder}");
@@ -20,7 +19,7 @@ public static class Choco
2019
public static void Push(string packagesFolder, string apiKey, string source = "https://push.chocolatey.org/")
2120
{
2221
var packageFiles = Directory.GetFiles(packagesFolder, "*.nupkg");
23-
foreach(var packageFile in packageFiles)
22+
foreach (var packageFile in packageFiles)
2423
{
2524
Command.Execute("choco.exe", $"push {packageFile} --source {source} --key {apiKey}");
2625
}
@@ -29,7 +28,7 @@ public static class Choco
2928
public static void TryPush(string packagesFolder, string apiKey, string source = "https://push.chocolatey.org/")
3029
{
3130
var packageFiles = Directory.GetFiles(packagesFolder, "*.nupkg");
32-
foreach(var packageFile in packageFiles)
31+
foreach (var packageFile in packageFiles)
3332
{
3433
Command.Execute("choco.exe", $"push {packageFile} --source {source} --key {apiKey}");
3534
}
@@ -77,11 +76,11 @@ public static class Choco
7776
packageElement.Add(filesElement);
7877

7978
// Add the tools folder that contains "ChocolateyInstall.ps1"
80-
filesElement.Add(CreateFileElement(@"tools\*.*",$@"{packageId}\tools"));
79+
filesElement.Add(CreateFileElement(@"tools\*.*", $@"{packageId}\tools"));
8180
var srcGlobPattern = $@"{pathToBinaries}\**\*";
82-
filesElement.Add(CreateFileElement(srcGlobPattern,packageId));
81+
filesElement.Add(CreateFileElement(srcGlobPattern, packageId));
8382

84-
using (var fileStream = new FileStream("Chocolatey/chocolatey.nuspec",FileMode.Create))
83+
using (var fileStream = new FileStream("Chocolatey/chocolatey.nuspec", FileMode.Create))
8584
{
8685
new XDocument(packageElement).Save(fileStream);
8786
}

0 commit comments

Comments
 (0)
0