Skip to content

Commit 86b6077

Browse files
authored
Merge pull request #8691 from haskell/list-bin-newline
Fix #8664 redux: add EOL character to list-bin output
2 parents d24c52c + 4e1dcbe commit 86b6077

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cabal-install/src/Distribution/Client/CmdListBin.hs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,18 @@ listbinAction flags@NixStyleFlags{..} args globalFlags = do
133133

134134
case binfiles of
135135
[] -> die' verbosity "No target found"
136-
[exe] -> putStr $ withOutputMarker verbosity exe
136+
[exe] -> putStr $ withOutputMarker verbosity $ exe ++ "\n"
137137
-- Andreas, 2023-01-13, issue #8400:
138138
-- Regular output of `list-bin` should go to stdout unconditionally,
139139
-- but for the sake of the testsuite, we want to mark it so it goes
140140
-- into the golden value for the test.
141141
-- Note: 'withOutputMarker' only checks 'isVerboseMarkOutput',
142142
-- thus, we can reuse @verbosity@ here, even if other components
143143
-- of @verbosity@ may be wrong (like 'VStderr', verbosity level etc.).
144+
-- Andreas, 2023-01-20:
145+
-- Appending the newline character here rather than using 'putStrLn'
146+
-- because an active 'withOutputMarker' produces text that ends
147+
-- in newline characters.
144148
_ -> die' verbosity "Multiple targets found"
145149
where
146150
defaultVerbosity = verboseStderr silent

0 commit comments

Comments
 (0)