avoid uname -o on !linux and catch any exception from it
Fix bug in last release that prevented the webapp opening on non-Linux systems. This commit was sponsored by Jake Vosloo on Patreon.
This commit is contained in:
parent
b2e03bb428
commit
2948f6d916
4 changed files with 24 additions and 2 deletions
|
@ -1,3 +1,5 @@
|
|||
{-# LANGUAGE CPP #-}
|
||||
|
||||
{- Android stuff
|
||||
-
|
||||
- Copyright 2018 Joey Hess <id@joeyh.name>
|
||||
|
@ -14,4 +16,9 @@ import Common
|
|||
-- Note that this relies on termux's uname having been built with "Android"
|
||||
-- as the os name. Often on Android, uname will report "Linux".
|
||||
osAndroid :: IO Bool
|
||||
osAndroid = ("Android" `isPrefixOf` ) <$> readProcess "uname" ["-o"]
|
||||
#ifdef linux_HOST_OS
|
||||
osAndroid = catchDefaultIO False $
|
||||
("Android" `isPrefixOf` ) <$> readProcess "uname" ["-o"]
|
||||
#else
|
||||
osAndroid = return False
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue