summaryrefslogtreecommitdiff
path: root/CmdLine/GitAnnexShell/Checks.hs
diff options
context:
space:
mode:
Diffstat (limited to 'CmdLine/GitAnnexShell/Checks.hs')
-rw-r--r--CmdLine/GitAnnexShell/Checks.hs10
1 files changed, 4 insertions, 6 deletions
diff --git a/CmdLine/GitAnnexShell/Checks.hs b/CmdLine/GitAnnexShell/Checks.hs
index 47bc11a76..fcbf14b24 100644
--- a/CmdLine/GitAnnexShell/Checks.hs
+++ b/CmdLine/GitAnnexShell/Checks.hs
@@ -21,12 +21,10 @@ checkNotReadOnly :: IO ()
checkNotReadOnly = checkEnv "GIT_ANNEX_SHELL_READONLY"
checkEnv :: String -> IO ()
-checkEnv var = do
- v <- getEnv var
- case v of
- Nothing -> noop
- Just "" -> noop
- Just _ -> giveup $ "Action blocked by " ++ var
+checkEnv var = getEnv var >>= \case
+ Nothing -> noop
+ Just "" -> noop
+ Just _ -> giveup $ "Action blocked by " ++ var
checkDirectory :: Maybe FilePath -> IO ()
checkDirectory mdir = do