1
+ using System ;
1
2
using Common ;
2
3
using Common . YamlParsers ;
3
4
using System . IO ;
@@ -10,6 +11,7 @@ public class PackCommand : Command
10
11
private string project ;
11
12
private string configuration ;
12
13
private BuildSettings buildSettings ;
14
+ private bool preRelease = false ;
13
15
14
16
public PackCommand ( ) : base ( new CommandSettings
15
17
{
@@ -35,7 +37,7 @@ protected override int Execute()
35
37
var csproj = new ProjectFile ( projectPath ) ;
36
38
var deps = new DepsParser ( modulePath ) . Get ( configuration ) ;
37
39
ConsoleWriter . WriteInfo ( "patching csproj" ) ;
38
- var patchedDocument = csproj . CreateCsProjWithNugetReferences ( deps . Deps , modulePath ) ;
40
+ var patchedDocument = csproj . CreateCsProjWithNugetReferences ( deps . Deps , preRelease ) ;
39
41
var backupFileName = Path . Combine ( Path . GetDirectoryName ( projectPath ) ?? "" , "backup." + Path . GetFileName ( projectPath ) ) ;
40
42
if ( File . Exists ( backupFileName ) )
41
43
File . Delete ( backupFileName ) ;
@@ -46,7 +48,8 @@ protected override int Execute()
46
48
var moduleBuilder = new ModuleBuilder ( Log , buildSettings ) ;
47
49
moduleBuilder . Init ( ) ;
48
50
ConsoleWriter . WriteInfo ( "start pack" ) ;
49
- moduleBuilder . DotnetPack ( modulePath , projectPath , buildData ? . Configuration ?? "Release" ) ;
51
+ if ( ! moduleBuilder . DotnetPack ( modulePath , projectPath , buildData ? . Configuration ?? "Release" ) )
52
+ return - 1 ;
50
53
}
51
54
finally
52
55
{
@@ -64,6 +67,8 @@ protected override void ParseArgs(string[] args)
64
67
//dep = new Dep((string)parsedArgs["module"]);
65
68
if ( parsedArgs [ "configuration" ] != null )
66
69
configuration = ( string ) parsedArgs [ "configuration" ] ;
70
+ preRelease = ( bool ) parsedArgs [ "prerelease" ] ;
71
+
67
72
buildSettings = new BuildSettings
68
73
{
69
74
ShowAllWarnings = ( bool ) parsedArgs [ "warnings" ] ,
0 commit comments