Skip to content

Commit

Permalink
Change Copy-FilesToModuleDirectory to output path to .psd1
Browse files Browse the repository at this point in the history
  • Loading branch information
natescherer committed Aug 1, 2023
1 parent e758e7a commit 60fa69a
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/private/Copy-FilesToModuleDirectory.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 60fa69a

Please sign in to comment.