Skip to content

Commit 346969e

Browse files
daxian-dbwkalgiz
authored andcommitted
FixBuild: Revert the changes to get Pester from NuGet cache (PowerShell#6282)
Attempt to fix the macOS build. In PowerShell#6263, I tried flushing the cache and it worked in the PR. However, after merging the PR, it turns out the master CI build failed again with the same Pester package restore error. So I'm reverting the change that got Pester from NuGet cache.
1 parent 6dea7ea commit 346969e

2 files changed

Lines changed: 3 additions & 30 deletions

File tree

build.psm1

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ function Restore-PSPester
671671
[ValidateNotNullOrEmpty()]
672672
[string] $Destination = ([IO.Path]::Combine((Split-Path (Get-PSOptions -DefaultToNew).Output), "Modules"))
673673
)
674-
Copy-PSGalleryModules -Destination $Destination -ModuleNames Pester
674+
Save-Module -Name Pester -Path $Destination -Repository PSGallery
675675
}
676676

677677
function Compress-TestContent {
@@ -2303,15 +2303,9 @@ function Copy-PSGalleryModules
23032303
[CmdletBinding()]
23042304
param(
23052305
[Parameter(Mandatory=$true)]
2306-
[string]$Destination,
2307-
2308-
[Parameter()]
2309-
[ValidateNotNullOrEmpty()]
2310-
[string[]]$ModuleNames
2306+
[string]$Destination
23112307
)
23122308

2313-
$ModulesOnlyForCI = @("Pester")
2314-
23152309
if (!$Destination.EndsWith("Modules")) {
23162310
throw "Installing to an unexpected location"
23172311
}
@@ -2329,15 +2323,6 @@ function Copy-PSGalleryModules
23292323
foreach ($m in $psGalleryProj.Project.ItemGroup.PackageReference) {
23302324
$name = $m.Include
23312325
$version = $m.Version
2332-
2333-
if ($null -ne $ModuleNames) {
2334-
# When '-ModuleNames' is specified, then we only copy those specified modules
2335-
if ($name -notin $ModuleNames) { continue }
2336-
} else {
2337-
# When '-ModuleNames' is NOT specified, copy all modules except the CI-only ones
2338-
if ($name -in $ModulesOnlyForCI) { continue }
2339-
}
2340-
23412326
log "Name='$Name', Version='$version', Destination='$Destination'"
23422327

23432328
# Remove the build revision from the src (nuget drops it).
@@ -2361,18 +2346,7 @@ function Copy-PSGalleryModules
23612346
Remove-Item -Force -ErrorAction Ignore -Recurse "$Destination/$name"
23622347
New-Item -Path $dest -ItemType Directory -Force -ErrorAction Stop > $null
23632348
$dontCopy = '*.nupkg', '*.nupkg.sha512', '*.nuspec', 'System.Runtime.InteropServices.RuntimeInformation.dll'
2364-
2365-
switch ($name)
2366-
{
2367-
"Pester" {
2368-
$toolsDir = Join-Path -Path $src -ChildPath "tools"
2369-
Copy-Item -Path $toolsDir/* -Destination $dest -Recurse -Force
2370-
}
2371-
2372-
default {
2373-
Copy-Item -Exclude $dontCopy -Recurse $src/* $dest
2374-
}
2375-
}
2349+
Copy-Item -Exclude $dontCopy -Recurse $src/* $dest
23762350
}
23772351
}
23782352

src/Modules/PSGalleryModules.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<PackageReference Include="PackageManagement" Version="1.1.7.0" />
77
<PackageReference Include="PowerShellGet" Version="1.6.0" />
88
<PackageReference Include="Microsoft.PowerShell.Archive" Version="1.1.0.0" />
9-
<PackageReference Include="Pester" Version="4.3.1" />
109
</ItemGroup>
1110

1211
</Project>

0 commit comments

Comments
 (0)