summaryrefslogtreecommitdiffhomepage
path: root/Role/User.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Role/User.hs')
-rw-r--r--Role/User.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/Role/User.hs b/Role/User.hs
index efbbb24..99a8a1a 100644
--- a/Role/User.hs
+++ b/Role/User.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE OverloadedStrings, TupleSections #-}
module Role.User where
@@ -19,8 +19,10 @@ import System.Exit
import qualified Data.ByteString as B
import Data.List.NonEmpty (NonEmpty(..), toList)
import Data.Monoid
+import Data.Maybe
import Data.Time.Clock.POSIX
import System.IO
+import System.Environment
run :: UserOpts -> IO ExitCode
run os = do
@@ -44,7 +46,9 @@ run os = do
return exitstatus
shellCommand :: UserOpts -> IO (String, [String])
-shellCommand os = return ("dash", [])
+shellCommand os = case cmdToRun os of
+ Just v -> return v
+ Nothing -> (, []) . fromMaybe "bash" <$> lookupEnv "SHELL"
-- | Log of recent Activity, with the most recent first.
type Backlog = NonEmpty Log