Skip to content

Commit ab92942

Browse files
committed
ui-tests: trim the output in RunWaitOne()
This imitates Unix shell's `$(...)` behavior better and is eminently more useful when capturing, say, the output of `cygpath`. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent f33e06e commit ab92942

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ui-tests/ui-test-library.ahk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ RunWaitOne(command) {
6161
exec := shell.Run(A_ComSpec " /C " command " | clip", 0, true)
6262
if exec != 0
6363
ExitWithError 'Error executing command: ' command
64-
; Read and return the command's output
65-
Result := A_Clipboard
64+
; Read and return the command's output, trimming trailing newlines.
65+
Result := RegExReplace(A_Clipboard, '`r?`n$', '')
6666
Clipboard := SavedClipboard
6767
return Result
6868
}

0 commit comments

Comments
 (0)