Skip to content

Commit

Permalink
specify nupkg folder in repo URI
Browse files Browse the repository at this point in the history
  • Loading branch information
anamnavi committed Sep 25, 2023
1 parent 3a583e9 commit 4a3d9a5
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions buildtools.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -109,25 +109,16 @@ function Install-ModulePackageForTest {
$config = Get-BuildConfiguration

$localRepoName = 'packagebuild-local-repo'
Write-Verbose -Verbose -Message "Registering local package repo: $localRepoName to path: $PackagePath"
Register-PSResourceRepository -Name $localRepoName -Uri $PackagePath -Trusted -Force

$repo2Path = Join-Path -Path $PackagePath -ChildPath "nupkg"
Register-PSResourceRepository -Name "localRepo2" -Uri $repo2Path -Trusted -Force

$repo = Get-PSResourceRepository -Name $localRepoName
$repoPathWithoutFile = $repo.Uri.ToString().TrimStart("file:///")
Get-ChildItem -Path $repoPathWithoutFile -Recurse
$packagePathWithNupkg = Join-Path -Path $PackagePath -ChildPath "nupkg"
Write-Verbose -Verbose -Message "Registering local package repo: $localRepoName to path: $packagePathWithNupkg"
Register-PSResourceRepository -Name $localRepoName -Uri $packagePathWithNupkg -Trusted -Force

$installationPath = $config.BuildOutputPath
if ( !(Test-Path $installationPath)) {
Write-Verbose -Verbose -Message "Creating module directory location for tests: $installationPath"
$null = New-Item -Path $installationPath -ItemType Directory -Verbose
}

Write-Verbose -Verbose "locate package from repo 2"
$res2 = Find-PSResource -Name $config.ModuleName -Repository "localRepo2" -Prerelease -Verbose -Debug
Write-Verbose -Verbose $res2.Name
Write-Verbose -Verbose -Message "Installing module $($config.ModuleName) to build output path $installationPath"
$res = Find-PSResource -Name $config.ModuleName -Repository $localRepoName -Prerelease -Verbose -Debug
Write-Verbose -Verbose $res.Name
Expand Down

0 comments on commit 4a3d9a5

Please sign in to comment.