fix:demo: avoid breaking asciinema 2.3.0 (fix #2094)
We were adding a trailing newline, which causes asciinema 2.3.0 to show a JSON decode error.
This commit is contained in:
parent
63d41b30db
commit
d8021ef754
@ -148,8 +148,11 @@ printDemos = putStrLn $ unlines $
|
|||||||
-- | Run asciinema play with the given speed and idle limit, passing the given content to its stdin.
|
-- | Run asciinema play with the given speed and idle limit, passing the given content to its stdin.
|
||||||
runAsciinemaPlay :: Float -> Float -> ByteString -> [String] -> IO ()
|
runAsciinemaPlay :: Float -> Float -> ByteString -> [String] -> IO ()
|
||||||
runAsciinemaPlay speed idlelimit content args =
|
runAsciinemaPlay speed idlelimit content args =
|
||||||
withSystemTempFile "hledger-cast" $ \f h -> do -- try piping to stdin also
|
-- XXX try piping to stdin also
|
||||||
B.hPutStrLn h content >> hClose h
|
withSystemTempFile "hledger-cast" $ \f h -> do
|
||||||
|
-- don't add an extra newline here, it breaks asciinema 2.3.0 (#2094).
|
||||||
|
-- XXX we could try harder and strip excess newlines/carriage returns+linefeeds here
|
||||||
|
B.hPutStr h content >> hClose h
|
||||||
callProcess "asciinema" (dbg8With (("asciinema: "++).unwords) $ concat [
|
callProcess "asciinema" (dbg8With (("asciinema: "++).unwords) $ concat [
|
||||||
["play"]
|
["play"]
|
||||||
,["-s"<> showwithouttrailingzero speed]
|
,["-s"<> showwithouttrailingzero speed]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user