1
- #load "nuget:Dotnet.Build, 0.3 .1"
1
+ #load "nuget:Dotnet.Build, 0.7 .1"
2
2
3
3
using System . Xml . Linq ;
4
4
@@ -11,7 +11,6 @@ public static class Choco
11
11
/// <param name="outputFolder">The path to the output folder (*.nupkg)</param>
12
12
public static void Pack ( string pathToProjectFolder , string pathToBinaries , string outputFolder )
13
13
{
14
- File . Copy ( Path . Combine ( pathToProjectFolder , "../../LICENSE" ) , Path . Combine ( "Chocolatey" , "tools" , "LICENSE.TXT" ) , true ) ;
15
14
string pathToProjectFile = Directory . GetFiles ( pathToProjectFolder , "*.csproj" ) . Single ( ) ;
16
15
CreateSpecificationFromProject ( pathToProjectFile , pathToBinaries ) ;
17
16
Command . Execute ( "choco.exe" , $@ "pack Chocolatey\chocolatey.nuspec --outputdirectory { outputFolder } ") ;
@@ -20,7 +19,7 @@ public static class Choco
20
19
public static void Push ( string packagesFolder , string apiKey , string source = "https://push.chocolatey.org/" )
21
20
{
22
21
var packageFiles = Directory . GetFiles ( packagesFolder , "*.nupkg" ) ;
23
- foreach ( var packageFile in packageFiles )
22
+ foreach ( var packageFile in packageFiles )
24
23
{
25
24
Command . Execute ( "choco.exe" , $ "push { packageFile } --source { source } --key { apiKey } ") ;
26
25
}
@@ -29,7 +28,7 @@ public static class Choco
29
28
public static void TryPush ( string packagesFolder , string apiKey , string source = "https://push.chocolatey.org/" )
30
29
{
31
30
var packageFiles = Directory . GetFiles ( packagesFolder , "*.nupkg" ) ;
32
- foreach ( var packageFile in packageFiles )
31
+ foreach ( var packageFile in packageFiles )
33
32
{
34
33
Command . Execute ( "choco.exe" , $ "push { packageFile } --source { source } --key { apiKey } ") ;
35
34
}
@@ -77,11 +76,11 @@ public static class Choco
77
76
packageElement . Add ( filesElement ) ;
78
77
79
78
// Add the tools folder that contains "ChocolateyInstall.ps1"
80
- filesElement . Add( CreateFileElement ( @"tools\*.*" , $@ "{ packageId } \tools") ) ;
79
+ filesElement . Add ( CreateFileElement ( @"tools\*.*" , $@ "{ packageId } \tools") ) ;
81
80
var srcGlobPattern = $@ "{ pathToBinaries } \**\*";
82
- filesElement . Add ( CreateFileElement ( srcGlobPattern , packageId ) ) ;
81
+ filesElement . Add ( CreateFileElement ( srcGlobPattern , packageId ) ) ;
83
82
84
- using ( var fileStream = new FileStream ( "Chocolatey/chocolatey.nuspec" , FileMode . Create ) )
83
+ using ( var fileStream = new FileStream ( "Chocolatey/chocolatey.nuspec" , FileMode . Create ) )
85
84
{
86
85
new XDocument ( packageElement ) . Save ( fileStream ) ;
87
86
}
0 commit comments