From 31ecc9f4f24b35e1db86829a7a6de8c47a819d13 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Mon, 23 Oct 2023 14:21:20 +0100 Subject: [PATCH] imp:demo: improve error message when asciinema fails --- hledger/Hledger/Cli/Commands/Demo.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hledger/Hledger/Cli/Commands/Demo.hs b/hledger/Hledger/Cli/Commands/Demo.hs index 83cda62a1..7ee9333cb 100644 --- a/hledger/Hledger/Cli/Commands/Demo.hs +++ b/hledger/Hledger/Cli/Commands/Demo.hs @@ -161,7 +161,10 @@ runAsciinemaPlay speed idlelimit content args = ,args ]) `catchIOError` \err -> do - putStrLn $ "There was a problem. Is asciinema installed ?\n" <> show err -- (or PowerSession on Windows) + putStrLn $ "\n" <> show err + putStrLn "Error: running asciinema failed. Trying 'asciinema --version':" + callProcess "asciinema" ["--version"] `catchIOError` \_ -> + putStrLn "This also failed. Check that asciinema is installed in your PATH." exitFailure where showwithouttrailingzero = dropWhileEnd (=='.') . dropWhileEnd (=='0') . show