Skip to content

Commit 41c28c3

Browse files
authored
Add "[DRY RUN]" to process execution output logging (#1695)
1 parent f4c1d80 commit 41c28c3

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/Microsoft.DotNet.ImageBuilder/src/ExecuteHelper.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ private static string Execute(
7575
{
7676
info.RedirectStandardError = true;
7777
executeMessageOverride ??= $"{info.FileName} {info.Arguments}";
78-
s_loggerService.WriteSubheading($"EXECUTING: {executeMessageOverride}");
78+
string prefix = isDryRun ? "EXECUTING [DRY RUN]" : "EXECUTING";
79+
s_loggerService.WriteSubheading($"{prefix}: {executeMessageOverride}");
7980

8081
if (isDryRun)
8182
{
@@ -91,7 +92,7 @@ private static string Execute(
9192
if (processResult.Process.ExitCode != 0)
9293
{
9394
string exceptionMsg = errorMessage ?? $@"Failed to execute {info.FileName} {info.Arguments}
94-
95+
9596
{processResult.StandardError}";
9697

9798
throw new InvalidOperationException(exceptionMsg);

0 commit comments

Comments
 (0)