Skip to content

Commit

Permalink
Make name optional in DotnetNewAsync
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaac Llopis authored and RehanSaeed committed Jun 29, 2020
1 parent 9c000d6 commit c6de6fc
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Source/Boxed.DotnetNewTest/TempDirectoryExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static class TempDirectoryExtensions
public static async Task<Project> DotnetNewAsync(
this TempDirectory tempDirectory,
string templateName,
string name,
string name = null,
IDictionary<string, string> arguments = null,
TimeSpan? timeout = null,
bool showShellWindow = false)
Expand All @@ -35,7 +35,13 @@ public static async Task<Project> DotnetNewAsync(
throw new ArgumentNullException(nameof(tempDirectory));
}

var stringBuilder = new StringBuilder($"new {templateName} --name \"{name}\"");
var stringBuilder = new StringBuilder($"new {templateName}");

if (name != null)
{
stringBuilder.Append($" --name \"{name}\"");
}

if (arguments is object)
{
foreach (var argument in arguments)
Expand Down

0 comments on commit c6de6fc

Please sign in to comment.