Skip to content

Commit ad37e50

Browse files
Fix casing in regex operators for consistency in Add-ContentFromItem and Build-PSModuleManifest
1 parent 209de1c commit ad37e50

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/helpers/Build/Add-ContentFromItem.ps1

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@
2525
# Get the path separator for the current OS
2626
$pathSeparator = [System.IO.Path]::DirectorySeparatorChar
2727

28-
$relativeFolderPath = $Path -Replace $RootPath, ''
29-
$relativeFolderPath = $relativeFolderPath -Replace $file.Extension, ''
28+
$relativeFolderPath = $Path -replace $RootPath, ''
29+
$relativeFolderPath = $relativeFolderPath -replace $file.Extension, ''
3030
$relativeFolderPath = $relativeFolderPath.TrimStart($pathSeparator)
31-
$relativeFolderPath = $relativeFolderPath -Split $pathSeparator | ForEach-Object { "[$_]" }
32-
$relativeFolderPath = $relativeFolderPath -Join ' - '
31+
$relativeFolderPath = $relativeFolderPath -split $pathSeparator | ForEach-Object { "[$_]" }
32+
$relativeFolderPath = $relativeFolderPath -join ' - '
3333

3434
Add-Content -Path $RootModuleFilePath -Force -Value @"
3535
#region $relativeFolderPath
@@ -38,11 +38,11 @@ Write-Debug "[`$scriptName] - $relativeFolderPath - Processing folder"
3838

3939
$files = $Path | Get-ChildItem -File -Force -Filter '*.ps1' | Sort-Object -Property FullName
4040
foreach ($file in $files) {
41-
$relativeFilePath = $file.FullName -Replace $RootPath, ''
42-
$relativeFilePath = $relativeFilePath -Replace $file.Extension, ''
41+
$relativeFilePath = $file.FullName -replace $RootPath, ''
42+
$relativeFilePath = $relativeFilePath -replace $file.Extension, ''
4343
$relativeFilePath = $relativeFilePath.TrimStart($pathSeparator)
44-
$relativeFilePath = $relativeFilePath -Split $pathSeparator | ForEach-Object { "[$_]" }
45-
$relativeFilePath = $relativeFilePath -Join ' - '
44+
$relativeFilePath = $relativeFilePath -split $pathSeparator | ForEach-Object { "[$_]" }
45+
$relativeFilePath = $relativeFilePath -join ' - '
4646

4747
Add-Content -Path $RootModuleFilePath -Force -Value @"
4848
#region $relativeFilePath

src/helpers/Build/Build-PSModuleManifest.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101

102102
# Get files on module subfolders, excluding the following folders 'init', 'classes', 'public', 'private'
103103
$skipList = @('init', 'classes', 'functions', 'variables')
104-
$ModuleOutputFolder | Get-ChildItem -Directory | Where-Object { $_.Name -NotIn $skipList } |
104+
$ModuleOutputFolder | Get-ChildItem -Directory | Where-Object { $_.Name -notin $skipList } |
105105
Get-ChildItem -Recurse -File -ErrorAction SilentlyContinue | ForEach-Object { $files.Add($_) }
106106

107107
# Get the relative file path and store it in the manifest

0 commit comments

Comments
 (0)