Skip to content

Commit c6de6fc

Browse files
Isaac LlopisRehanSaeed
authored andcommitted
Make name optional in DotnetNewAsync
1 parent 9c000d6 commit c6de6fc

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Source/Boxed.DotnetNewTest/TempDirectoryExtensions.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public static class TempDirectoryExtensions
2525
public static async Task<Project> DotnetNewAsync(
2626
this TempDirectory tempDirectory,
2727
string templateName,
28-
string name,
28+
string name = null,
2929
IDictionary<string, string> arguments = null,
3030
TimeSpan? timeout = null,
3131
bool showShellWindow = false)
@@ -35,7 +35,13 @@ public static async Task<Project> DotnetNewAsync(
3535
throw new ArgumentNullException(nameof(tempDirectory));
3636
}
3737

38-
var stringBuilder = new StringBuilder($"new {templateName} --name \"{name}\"");
38+
var stringBuilder = new StringBuilder($"new {templateName}");
39+
40+
if (name != null)
41+
{
42+
stringBuilder.Append($" --name \"{name}\"");
43+
}
44+
3945
if (arguments is object)
4046
{
4147
foreach (var argument in arguments)

0 commit comments

Comments
 (0)