Skip to content

Commit 72144c5

Browse files
authored
Merge pull request swiftlang#80775 from compnerd/encoding
utils: avoid redirection and use pipes for output redirection
2 parents 2c462ba + f6c63d4 commit 72144c5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

utils/build.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -765,13 +765,13 @@ function Invoke-Program() {
765765
if ($OutNull) {
766766
& $Executable @ExecutableArgs | Out-Null
767767
} elseif ($Silent) {
768-
& $Executable @ExecutableArgs *> $null
768+
& $Executable @ExecutableArgs | Out-Null 2>&1| Out-Null
769769
} elseif ($OutFile -and $ErrorFile) {
770-
& $Executable @ExecutableArgs > $OutFile 2> $ErrorFile
770+
& $Executable @ExecutableArgs | Out-File -FilePath $OutFile -Encoding UTF8 2>&1| Out-File -FilePath $ErrorFile -Encoding UTF8
771771
} elseif ($OutFile) {
772-
& $Executable @ExecutableArgs > $OutFile
772+
& $Executable @ExecutableArgs | Out-File -FilePath $OutFile -Encoding UTF8
773773
} elseif ($ErrorFile) {
774-
& $Executable @ExecutableArgs 2> $ErrorFile
774+
& $Executable @ExecutableArgs 2>&1| Out-File -FilePath $ErrorFile -Encoding UTF8
775775
} else {
776776
& $Executable @ExecutableArgs
777777
}

0 commit comments

Comments
 (0)