diff --git a/scripts/Custom-Hive.ps1 b/scripts/Custom-Hive.ps1 index 5ff80be557..f66bc12714 100644 --- a/scripts/Custom-Hive.ps1 +++ b/scripts/Custom-Hive.ps1 @@ -1,7 +1,6 @@ $customHive = "$PSScriptRoot/CustomHive" -function Test-Template($templateName, $templateNupkg, $isSPA) -{ +function Test-Template($templateName, $templateNupkg, $isSPA) { $tmpDir = "$PSScriptRoot/tmp" Remove-Item -Path $tmpDir -Recurse -ErrorAction Ignore @@ -13,18 +12,15 @@ function Test-Template($templateName, $templateNupkg, $isSPA) New-Item -ErrorAction Ignore -Path $tmpDir -ItemType Directory Push-Location $tmpDir try { - Run-DotnetNew $templateName - if($isSPA) - { - Push-Location "ClientApp" - try { - npm install - } - finally { - Pop-Location - } - } - dotnet run + Run-DotnetNew $templateName, "--no-restore" + $csproj = "$tmpDir/tmp.csproj" + $csprojContent = Get-Content -Path $csproj -Raw + $csprojContent = $csprojContent -replace ('', "`n") + $csprojContent | Set-Content $csproj + + dotnet publish + dotnet run bin\Release\netcoreapp2.2\publish\tmp.dll + } finally { Pop-Location diff --git a/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/Angular-CSharp.csproj.in b/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/Angular-CSharp.csproj.in index ef5ac3e904..e95e902c88 100644 --- a/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/Angular-CSharp.csproj.in +++ b/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/Angular-CSharp.csproj.in @@ -28,10 +28,7 @@ - + @@ -54,7 +51,7 @@ - + %(DistFiles.Identity) diff --git a/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/React-CSharp.csproj.in b/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/React-CSharp.csproj.in index 6b0b4825a9..95dc85dbd6 100644 --- a/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/React-CSharp.csproj.in +++ b/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/React-CSharp.csproj.in @@ -25,10 +25,7 @@ - + diff --git a/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/ReactRedux-CSharp.csproj.in b/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/ReactRedux-CSharp.csproj.in index ce38fd44ce..5b6d2ee374 100644 --- a/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/ReactRedux-CSharp.csproj.in +++ b/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/ReactRedux-CSharp.csproj.in @@ -25,10 +25,7 @@ - + @@ -50,7 +47,7 @@ - + %(DistFiles.Identity) PreserveNewest