packages feed

cli-setup 0.2.0.2 → 0.2.0.3

raw patch · 2 files changed

+9/−7 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

cli-setup.cabal view
@@ -1,6 +1,6 @@ cabal-version: 1.18 name: cli-setup-version: 0.2.0.2+version: 0.2.0.3 license: BSD3 license-file: LICENSE copyright: Copyright: (c) 2018 Vanessa McHale
src/Distribution/CommandLine.hs view
@@ -7,11 +7,11 @@     , writeTheFuck     ) where -import           Control.Monad      (unless, void)+import           Control.Monad      (unless, void, when) import           Data.Bool          (bool) import           Data.FileEmbed     (embedStringFile) import           System.Directory   (createDirectoryIfMissing,-                                     doesDirectoryExist)+                                     doesDirectoryExist, doesFileExist) import           System.Environment (lookupEnv) import           System.Process     (readCreateProcessWithExitCode, shell) @@ -39,10 +39,12 @@     case home of         Just x -> do             let bashRc = x ++ "/.bashrc"-            config <- readFile bashRc-            unless ("#manpath updated by cli-setup" `elem` lines config && length config > 0)-                (appendFile bashRc "\n#manpath updated by cli-setup\nexport MANPATH=~/.local/share:$MANPATH\n" >>-                 void (readCreateProcessWithExitCode (shell $ "MANPATH=" ++ x ++ "/.local/share mandb") ""))+            b <- doesFileExist bashRc+            when b $ do+                config <- readFile bashRc+                unless ("#manpath updated by cli-setup" `elem` lines config && length config > 0)+                    (appendFile bashRc "\n#manpath updated by cli-setup\nexport MANPATH=~/.local/share:$MANPATH\n" >>+                    void (readCreateProcessWithExitCode (shell $ "MANPATH=" ++ x ++ "/.local/share mandb") ""))         Nothing -> pure ()  -- | As an example, if your source tarball contains a file @man/madlang.1@ you