Skip to content

Commit 9c0f957

Browse files
author
James Brundage
committed
Updating [include] transpiler (avoiding unrelated files) (#96)
1 parent eb3ae51 commit 9c0f957

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Transpilers/Include.psx.ps1

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
} | .>PipeScript
1515
.EXAMPLE
1616
{
17-
[Include('*-*.ps1')]$psScriptRoot
17+
[Include('*-*.ps1')]$psScriptRoot
1818
} | .>PipeScript
1919
#>
2020
param(
@@ -62,8 +62,7 @@ function IncludeFileContents {
6262
"'@" + @'
6363
-split "[\r\n]{1,2}" -replace "^@''", "@'" -replace "^''@", "'@" -join [Environment]::NewLine
6464
'@
65-
)
66-
65+
)
6766
}
6867
}
6968
}
@@ -131,7 +130,7 @@ if ($psCmdlet.ParameterSetName -eq 'ScriptBlock' -or
131130
[ScriptBlock]::Create(@"
132131
foreach (`$file in (Get-ChildItem -Path "$($VariableAst)" -Filter "$FilePath" -Recurse)) {
133132
if (`$file.Extension -ne '.ps1') { continue } # Skip if the extension is not .ps1
134-
if (`$file.Name -match '\.ps1\.ps1$') { continue } # Skip if the file is a source generator.
133+
if (`$file.Name -match '\.[^\.]\.ps1$') { continue } # Skip if the file is an unrelated file.
135134
. `$file.FullName
136135
}
137136
"@)

0 commit comments

Comments
 (0)