File tree Expand file tree Collapse file tree 2 files changed +11
-10
lines changed
src/ProjectTemplates/scripts Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change 7878 $templateArguments += " --use-program-main"
7979 }
8080
81- Import-Module - Name " $PSScriptRoot /Test-Template.psm1" ;
81+ Import-Module - Name " $PSScriptRoot /Test-Template.psm1" - Force ;
8282
8383 Test-Template `
8484 - TemplateName " MyBlazorApp" `
Original file line number Diff line number Diff line change @@ -172,17 +172,18 @@ function Test-Template {
172172 $tmpDir = " $PSScriptRoot /$templateName " ;
173173 Write-Verbose " Template working directory: $tmpDir "
174174 Remove-Item - Path $tmpDir - Recurse - ErrorAction Ignore;
175- Write-Verbose " Running dotnet pack to build template packages..."
176- Push-Location ..;
177- try {
178- Write-Verbose " Current location for dotnet pack: $ ( Get-Location ) "
179- dotnet pack
180- }
181- finally {
182- Pop-Location ;
175+
176+ # Check if template packages exist (should be built by main CI build process)
177+ $PackagePathPattern = " $PSScriptRoot /../../../artifacts/packages/$Configuration /Shipping/$TemplatePackagePath "
178+ Write-Verbose " Looking for template packages at: $PackagePathPattern "
179+
180+ $PackagePath = Get-ChildItem - Path " $PSScriptRoot /../../../artifacts/packages/$Configuration /Shipping/" - Filter $TemplatePackagePath - ErrorAction SilentlyContinue | Select-Object - First 1
181+ if (-not $PackagePath ) {
182+ Write-Error " Template packages not found at $PackagePathPattern . Ensure the main build has completed with -pack option before running template tests."
183+ return
183184 }
184185
185- $PackagePath = Resolve-Path " $PSScriptRoot /../../../artifacts/packages/ $Configuration /Shipping/ $TemplatePackagePath " ;
186+ $PackagePath = $PackagePath .FullName
186187 Write-Verbose " Template package path: $PackagePath "
187188
188189 $PackageName = (Get-Item $PackagePath ).Name;
You can’t perform that action at this time.
0 commit comments