|
30 | 30 | $outputPath = "$($env:GITHUB_WORKSPACE)\$($Output)" |
31 | 31 | } |
32 | 32 |
|
33 | | - $modulePath = "$($outputPath)\$($ModuleName).psm1" |
| 33 | + $Module = Get-ChildItem -Path $SourcePath -Filter "$($ModuleName).psd1" -Recurse |
| 34 | + $ModuleRoot = $Module.Directory.FullName |
| 35 | + $Destination = "$($outputPath)\$($ModuleName)" |
| 36 | + $modulePath = "$($Destination)\$($ModuleName).psm1" |
34 | 37 |
|
35 | 38 | if ($Debug) |
36 | 39 | { |
37 | | - Write-Host "::debug::ModuleName : $($ModuleName)" |
38 | | - Write-Host "::debug::SourcePath : $($sourcePath)" |
39 | | - Write-Host "::debug::OutputPath : $($outputPath)" |
40 | | - Write-Host "::debug::ModulePath : $($modulePath)" |
41 | | - Write-Host "::debug::Imports : $($imports)" |
| 40 | + Write-Host "ModuleName : $($ModuleName)" |
| 41 | + Write-Host "SourcePath : $($sourcePath)" |
| 42 | + Write-Host "OutputPath : $($outputPath)" |
| 43 | + Write-Host "Destination : $($Destination)" |
| 44 | + Write-Host "ManifestPath : $($ManifestPath)" |
| 45 | + Write-Host "ModuleRoot : $($ModuleRoot)" |
| 46 | + Write-Host "Imports : $($imports)" |
42 | 47 | } |
43 | 48 |
|
44 | 49 | $stringbuilder = [System.Text.StringBuilder]::new() |
|
50 | 55 |
|
51 | 56 | if ($Debug) |
52 | 57 | { |
53 | | - Write-Host "::debug::Testing Output" |
| 58 | + Write-Host "Testing Output" |
54 | 59 | } |
55 | 60 |
|
56 | 61 | if (-not (Test-Path -Path $outputPath)) { |
|
60 | 65 | Write-Host "::group::Processing import folders..." |
61 | 66 | foreach ($importFolder in $importFolders) |
62 | 67 | { |
63 | | - Write-Host "Importing from [$($sourcePath)\$($importFolder)]" |
| 68 | + Write-Host "Importing from [$($ModuleRoot)\$($importFolder)]" |
64 | 69 | if ($Debug) |
65 | 70 | { |
66 | | - Write-Host "::debug::Testing ImportFolder" |
| 71 | + Write-Host "Testing ImportFolder" |
67 | 72 | } |
68 | | - if (Test-Path "$sourcePath\$importFolder") |
| 73 | + if (Test-Path "$ModuleRoot\$importFolder") |
69 | 74 | { |
70 | | - $fileList = Get-ChildItem "$($sourcePath)\$($importFolder)\*.ps1" -Exclude "*.Tests.ps1" |
| 75 | + $fileList = Get-ChildItem "$($ModuleRoot)\$($importFolder)\*.ps1" -Exclude "*.Tests.ps1" |
71 | 76 | foreach ($file in $fileList) |
72 | 77 | { |
73 | 78 | Write-Host " Importing [.$($file.BaseName)]" |
74 | 79 | if ($Debug) |
75 | 80 | { |
76 | | - Write-Host "::debug::Reading file: $file.FullName" |
| 81 | + Write-Host "Reading file: $file.FullName" |
77 | 82 | } |
78 | 83 | $stringbuilder.AppendLine("# .$($file.BaseName)") | Out-Null |
79 | 84 | $stringbuilder.AppendLine([System.IO.File]::ReadAllText($file.FullName)) | Out-Null |
80 | 85 | } |
81 | 86 | } |
82 | 87 | else |
83 | 88 | { |
84 | | - Write-Host "##[warning]Folder $importFolder not found at $sourcePath" |
| 89 | + Write-Host "##[warning]Folder $importFolder not found at $ModuleRoot" |
85 | 90 | } |
86 | 91 | } |
87 | 92 | Write-Host "::endgroup::" |
|
0 commit comments