Skip to content

Commit 9d070eb

Browse files
committed
Fix Update-ModuleManifest definition and call.
I had a similarly named function from another module masking this script.
1 parent 099c401 commit 9d070eb

File tree

2 files changed

+15
-17
lines changed

2 files changed

+15
-17
lines changed

MakeRelease.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ foreach ($file in $files)
4242

4343
$version = (Get-ChildItem $targetDir\PSReadline.dll).VersionInfo.FileVersion
4444

45-
Update-ModuleManifest $targetDir\PSReadline.psd1 $version
45+
& $PSScriptRoot\Update-ModuleManifest.ps1 $targetDir\PSReadline.psd1 $version
46+
4647

4748
del $PSScriptRoot\PSReadline.zip -ea Ignore
4849
[System.IO.Compression.ZipFile]::CreateFromDirectory($targetDir, "$PSScriptRoot\PSReadline.zip")

Update-ModuleManifest.ps1

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
1+
param (
2+
[Parameter(Mandatory=$TRUE)]
3+
[String] $FilePath,
4+
[Parameter(Mandatory=$TRUE)]
5+
[String] $Version
6+
)
17

2-
function Update-ModuleManifest {
3-
param (
4-
[Parameter(Mandatory=$TRUE)]
5-
[String] $FilePath,
6-
[Parameter(Mandatory=$TRUE)]
7-
[String] $Version
8-
)
9-
10-
if ((Test-Path $FilePath -PathType Leaf) -ne $TRUE) {
8+
if ((Test-Path $FilePath -PathType Leaf) -ne $TRUE) {
119
Write-Error -Message ($FilePath + ' not found.') -Category InvalidArgument;
1210
exit 1;
13-
}
11+
}
1412

15-
#normalize path
16-
$FilePath = (Resolve-Path $FilePath).Path;
13+
#normalize path
14+
$FilePath = (Resolve-Path $FilePath).Path;
1715

18-
$moduleVersionPattern = "ModuleVersion = '.*'";
19-
$newVersion = "ModuleVersion = '" + $Version + "'";
16+
$moduleVersionPattern = "ModuleVersion = '.*'";
17+
$newVersion = "ModuleVersion = '" + $Version + "'";
2018

21-
(Get-Content $FilePath) | % {$_ -replace $moduleVersionPattern, $newVersion} | Set-Content $FilePath;
22-
}
19+
(Get-Content $FilePath) | % {$_ -replace $moduleVersionPattern, $newVersion} | Set-Content $FilePath;

0 commit comments

Comments
 (0)