packages feed

madlang 4.0.0.1 → 4.0.0.2

raw patch · 2 files changed

+5/−47 lines, 2 filessetup-changed

Files

Setup.hs view
@@ -1,49 +1,8 @@-import           Control.Monad       (unless, void)-import           Data.Maybe+import           Distribution.CommandLine import           Distribution.Simple-import           System.Directory    (createDirectoryIfMissing)-import           System.Environment  (lookupEnv)-import           System.Process      (readCreateProcessWithExitCode, shell) -manpage :: IO String-manpage = readFile "man/madlang.1"- main :: IO () main = setManpath >>-    writeManpages >>-    writeBashCompletions >>+    writeManpages "man/madlang.1" "madlang.1" >>+    writeBashCompletions "madlang" >>     defaultMain--setManpath :: IO ()-setManpath = do-    home <- lookupEnv "HOME"-    case home of-        Just x -> do-            let bashRc = x ++ "/.bashrc"-            config <- readFile bashRc-            unless ("#manpath updated by madlang" `elem` lines config)-                (appendFile bashRc "\n#manpath updated by madlang\nexport MANPATH=~/.local/share:$MANPATH\n" >>-                 void (readCreateProcessWithExitCode (shell $ "MANPATH=" ++ x ++ "/.local/share mandb") ""))-        Nothing -> pure ()--writeManpages :: IO ()-writeManpages = do-    home <- lookupEnv "HOME"-    case home of-        Just x -> do-            let manPath = x ++ "/.local/share/man/man1"-            createDirectoryIfMissing True manPath-            writeFile (manPath ++ "/madlang.1") =<< manpage-        Nothing -> pure ()---- TODO only write if we can't find our own thing!-writeBashCompletions :: IO ()-writeBashCompletions = do-    home <- lookupEnv "HOME"-    case home of-        Just x -> do-            let bashRc = x ++ "/.bashrc"-            config <- readFile bashRc-            unless ("# Added by madlang" `elem` lines config)-                (appendFile bashRc "\n# Added by madlang\neval \"$(madlang --bash-completion-script madlang)\"\n")-        Nothing -> pure ()
madlang.cabal view
@@ -1,5 +1,5 @@ name:                madlang-version:             4.0.0.1+version:             4.0.0.2 synopsis:            Randomized templating language DSL description:         Madlang is a text templating language written in Haskell,                      meant to explore computational creativity and generative@@ -24,8 +24,7 @@ custom-setup   setup-depends:   base                  , Cabal-                 , directory-                 , process >= 1.4.0.0+                 , cli-setup >= 0.1.0.2  Flag profile {   Description: Build for profiling