Skip to content

Commit 2ffd995

Browse files
committed
DotNetSolution.Restore: fix for single-file programs.
1 parent eb66781 commit 2ffd995

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/PostSharp.Engineering.BuildTools/Build/Solutions/DotNetSolution.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,16 @@ public override bool Pack( BuildContext context, BuildSettings settings )
2828
public override bool Test( BuildContext context, BuildSettings settings ) => this.RunBuildOrTests( context, settings, test: true );
2929

3030
public override bool Restore( BuildContext context, BuildSettings settings )
31-
=> this.RunDotNet( context, settings, "restore", "--no-cache", addConfigurationFlag: false );
31+
{
32+
if ( this.IsSingleFile )
33+
{
34+
context.Console.WriteImportantMessage( "Restore skipped for single-file program." );
35+
36+
return true;
37+
}
38+
39+
return this.RunDotNet( context, settings, "restore", "--no-cache", addConfigurationFlag: false );
40+
}
3241

3342
private string GetFinalSolutionPath( BuildContext context )
3443
=> FileSystemHelper.GetFinalPath( Path.Combine( context.RepoDirectory, this.SolutionPath ) );

0 commit comments

Comments
 (0)