Skip to content

Commit c750cec

Browse files
author
maddieclayton
authored
Merge pull request #5090 from maddieclayton/addpsm1
Update RootModule at build time
2 parents 4a91dbb + 862b561 commit c750cec

File tree

2 files changed

+18
-20
lines changed

2 files changed

+18
-20
lines changed

tools/PublishModules.ps1

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -110,25 +110,6 @@ function Get-TargetModules
110110
}
111111
}
112112

113-
function Add-PSM1Dependency
114-
{
115-
[CmdletBinding()]
116-
param(
117-
[string] $Path)
118-
119-
PROCESS
120-
{
121-
$file = Get-Item -Path $Path
122-
$manifestFile = $file.Name
123-
$psm1file = $manifestFile -replace ".psd1", ".psm1"
124-
if($isNetCore -eq "false") {
125-
Update-ModuleManifest -Path $Path -RootModule $psm1file
126-
}
127-
}
128-
129-
}
130-
131-
132113
function Remove-ModuleDependencies
133114
{
134115
[CmdletBinding()]
@@ -216,7 +197,6 @@ function Change-RMModule
216197
Write-Output "Expanding $zipPath"
217198
Expand-Archive $zipPath -DestinationPath $dirPath
218199
Write-Output "Adding PSM1 dependency to $unzippedManifest"
219-
Add-PSM1Dependency -Path $unzippedManifest
220200
Write-Output "Removing module manifest dependencies for $unzippedManifest"
221201
Remove-ModuleDependencies -Path $unzippedManifest
222202
Remove-Item -Path $zipPath -Force

tools/UpdateModules.ps1

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,24 @@ function Create-ModulePsm1
7676
Write-Host "Writing psm1 manifest to $templateOutputPath"
7777
$template | Out-File -FilePath $templateOutputPath -Force
7878
$file = Get-Item -Path $templateOutputPath
79+
80+
Add-PSM1Dependency -Path $manifestPath
81+
}
82+
}
83+
84+
function Add-PSM1Dependency
85+
{
86+
[CmdletBinding()]
87+
param(
88+
[string] $Path)
89+
90+
PROCESS
91+
{
92+
$file = Get-Item -Path $Path
93+
$manifestFile = $file.Name
94+
$psm1file = $manifestFile -replace ".psd1", ".psm1"
95+
Write-Host "here" + $Path
96+
Update-ModuleManifest -Path $Path -RootModule $psm1file
7997
}
8098
}
8199

0 commit comments

Comments
 (0)