Skip to content

Commit 190be35

Browse files
author
James Brundage
committed
feat: Invoke-PipeScript Interpreter Simplification ( Fixes #941 )
Cleaning up spacing and docs.
1 parent 2e1b0e4 commit 190be35

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

Commands/PipeScript/Invoke-PipeScript.ps1

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -244,19 +244,15 @@
244244
}
245245
})
246246

247-
# If the command was not a source generator
248-
if ($Command.Source -notmatch $IsTemplateFile ) {
249-
# we'll try to invoke it.
250-
251-
# If we have an interpreter for that language
252-
if ($matchingPipeScriptLanguage.Interpreter -or $matchingPipeScriptLanguage.Runner) {
253-
# we'll want to run it.
254-
247+
# If the command was not a source generator we'll try to invoke it.
248+
if ($Command.Source -notmatch $IsTemplateFile ) {
249+
# If we have an interpreter for that language we'll want to run it.
250+
if ($matchingPipeScriptLanguage.Interpreter -or $matchingPipeScriptLanguage.Runner) {
255251
# Rather than duplicate a lot of code, the easiest way to do this is simply to alias the full path
256252
Set-Alias $command.Source Invoke-Interpreter
257253
# and reset the value of $Command
258254
$command = $ExecutionContext.SessionState.InvokeCommand.GetCommand($command.Source, 'Alias')
259-
# (the alias will only exist locally, and not exist when Invoke-PipeScript returns)
255+
# (the alias will only exist locally, and not exist when Invoke-PipeScript returns)
260256
}
261257

262258
$CommandStart = [DateTime]::now

0 commit comments

Comments
 (0)