From 89ca48bd05d5913e6497becf304e8dc1241f5cca Mon Sep 17 00:00:00 2001 From: David Fowler Date: Wed, 3 Feb 2016 22:19:41 -0800 Subject: [PATCH] Remove project.json in template to avoid restore --- .../CSharp_Console/{project.json => project.json.template} | 0 .../FSharp_Console/{project.json => project.json.template} | 0 src/dotnet/commands/dotnet-new/Program.cs | 6 ++++++ src/dotnet/project.json | 4 ++-- 4 files changed, 8 insertions(+), 2 deletions(-) rename src/dotnet/commands/dotnet-new/CSharp_Console/{project.json => project.json.template} (100%) rename src/dotnet/commands/dotnet-new/FSharp_Console/{project.json => project.json.template} (100%) 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",