diff --git a/src/dotnet/commands/dotnet-new/CSharp_Console/project.json b/src/dotnet/commands/dotnet-new/CSharp_Console/project.json.template similarity index 100% rename from src/dotnet/commands/dotnet-new/CSharp_Console/project.json rename to src/dotnet/commands/dotnet-new/CSharp_Console/project.json.template diff --git a/src/dotnet/commands/dotnet-new/FSharp_Console/project.json b/src/dotnet/commands/dotnet-new/FSharp_Console/project.json.template similarity index 100% rename from src/dotnet/commands/dotnet-new/FSharp_Console/project.json rename to src/dotnet/commands/dotnet-new/FSharp_Console/project.json.template diff --git a/src/dotnet/commands/dotnet-new/Program.cs b/src/dotnet/commands/dotnet-new/Program.cs index c1cf749a1..dbeb51a4e 100644 --- a/src/dotnet/commands/dotnet-new/Program.cs +++ b/src/dotnet/commands/dotnet-new/Program.cs @@ -19,6 +19,12 @@ namespace Microsoft.DotNet.Tools.New return null; } + // filename.extension.template + if (parts.Length > 2 && string.Equals("template", parts[parts.Length - 1], StringComparison.OrdinalIgnoreCase)) + { + return parts[parts.Length - 3] + "." + parts[parts.Length - 2]; + } + // filename.extension return parts[parts.Length - 2] + "." + parts[parts.Length - 1]; } diff --git a/src/dotnet/project.json b/src/dotnet/project.json index d686c706f..e6afe8a78 100644 --- a/src/dotnet/project.json +++ b/src/dotnet/project.json @@ -10,10 +10,10 @@ "resource": [ "commands/dotnet-new/CSharp_Console/NuGet.Config", "commands/dotnet-new/CSharp_Console/Program.cs", - "commands/dotnet-new/CSharp_Console/project.json", + "commands/dotnet-new/CSharp_Console/project.json.template", "commands/dotnet-new/FSharp_Console/NuGet.config", "commands/dotnet-new/FSharp_Console/Program.fs", - "commands/dotnet-new/FSharp_Console/project.json" + "commands/dotnet-new/FSharp_Console/project.json.template" ], "dependencies": { "Newtonsoft.Json": "7.0.1",