From 60fa69a31d2a30112f5158ae0c6f16efa230f75c Mon Sep 17 00:00:00 2001 From: Nate Scherer <376408+natescherer@users.noreply.github.com> Date: Tue, 1 Aug 2023 17:38:25 -0400 Subject: [PATCH] Change Copy-FilesToModuleDirectory to output path to .psd1 --- src/private/Copy-FilesToModuleDirectory.ps1 | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/private/Copy-FilesToModuleDirectory.ps1 b/src/private/Copy-FilesToModuleDirectory.ps1 index 461cd33..5ac9892 100644 --- a/src/private/Copy-FilesToModuleDirectory.ps1 +++ b/src/private/Copy-FilesToModuleDirectory.ps1 @@ -6,22 +6,23 @@ function Copy-FilesToModuleDirectory { ) # PowerShellGet currently requires the module be in a folder named the same as the manifest - $OutputPath = "" + $NewBasePath = "" Write-Host "Creating directory for module publishing..." $ManifestName = Split-Path -Path $Path -LeafBase $ManifestDir = Split-Path -Path $Path -Parent - $OutputPath = Join-Path $env:RUNNER_TEMP $ManifestName + $NewBasePath = Join-Path $env:RUNNER_TEMP $ManifestName - If (Test-Path $OutputPath) { - Remove-Item -LiteralPath $OutputPath -Force -Recurse + If (Test-Path $NewBasePath) { + Remove-Item -LiteralPath $NewBasePath -Force -Recurse } - Write-Host "Copying files from $ManifestDir to $OutputPath..." - New-Item -Path $OutputPath -Type Directory | Out-Null - Copy-Item -Path "$ManifestDir\*" -Destination $OutputPath -Recurse + Write-Host "Copying files from $ManifestDir to $NewBasePath..." + New-Item -Path $NewBasePath -Type Directory | Out-Null + Copy-Item -Path "$ManifestDir\*" -Destination $NewBasePath -Recurse + $OutputPath = $NewBasePath + $(Split-Path -Path $Path -Leaf) $OutputPath } \ No newline at end of file