Fix changelog subcommand on darwin

This commit is contained in:
Julian Ospald 2020-07-13 23:10:17 +02:00
parent 2e0bbca2e0
commit 63c70ee74b
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28
2 changed files with 11 additions and 2 deletions

View File

@ -283,7 +283,11 @@ changelog' AppState {..} (_, ListResult {..}) = do
Nothing -> pure $ Left
[i|Could not find ChangeLog for #{lTool}, version #{prettyVer lVer}|]
Just uri -> do
exec "xdg-open" True [serializeURIRef' uri] Nothing Nothing >>= \case
let cmd = case _rPlatform pfreq of
Darwin -> "open"
Linux _ -> "xdg-open"
FreeBSD -> "xdg-open"
exec cmd True [serializeURIRef' uri] Nothing Nothing >>= \case
Right _ -> pure $ Right ()
Left e -> pure $ Left [i|#{e}|]

View File

@ -1308,9 +1308,14 @@ Make sure to clean up #{tmpdir} afterwards.|])
pure ExitSuccess
Just uri -> do
let uri' = T.unpack . decUTF8Safe . serializeURIRef' $ uri
cmd = case _rPlatform pfreq of
Darwin -> "open"
Linux _ -> "xdg-open"
FreeBSD -> "xdg-open"
if clOpen
then
exec "xdg-open"
exec cmd
True
[serializeURIRef' uri]
Nothing