shelly 0.8.0.1 → 0.8.0.2
raw patch · 2 files changed
+16/−14 lines, 2 files
Files
- Shelly.hs +14/−10
- shelly.cabal +2/−4
Shelly.hs view
@@ -145,21 +145,13 @@ cmd fp args = run fp $ toTextArgs args -} --- | Helper to convert a Text to a FilePath. Used for arguments to 'cmd'-class ToFilePath a where- toFilePath :: a -> FilePath--instance ToFilePath FilePath where toFilePath = id-instance ToFilePath Text where toFilePath = fromText-instance ToFilePath T.Text where toFilePath = FP.fromText-instance ToFilePath String where toFilePath = FP.fromText . T.pack-+-- | Converter for the variadic argument version of 'run' called 'cmd'. class ShellArg a where toTextArg :: a -> Text instance ShellArg Text where toTextArg = id instance ShellArg FilePath where toTextArg = toTextIgnore --- | For the variadic argument version of 'run' called 'cmd'.+-- Voodoo to create the variadic function 'cmd' class ShellCommand t where cmdAll :: FilePath -> [Text] -> t @@ -190,6 +182,16 @@ cmd :: (ShellCommand result) => FilePath -> result cmd fp = cmdAll fp [] +-- | Helper to convert a Text to a FilePath. Used by '(</>)' and '(<.>)'+class ToFilePath a where+ toFilePath :: a -> FilePath++instance ToFilePath FilePath where toFilePath = id+instance ToFilePath Text where toFilePath = fromText+instance ToFilePath T.Text where toFilePath = FP.fromText+instance ToFilePath String where toFilePath = FP.fromText . T.pack++ -- | uses System.FilePath.CurrentOS, but can automatically convert a Text (</>) :: (ToFilePath filepath1, ToFilePath filepath2) => filepath1 -> filepath2 -> FilePath x </> y = toFilePath x FP.</> toFilePath y@@ -551,6 +553,7 @@ avail <- Sem.peekAvail sem if avail == limit then return () else waitForJobs sem +-- | The manager tracks the number of jobs. Register your 'background' jobs with it. newtype BgJobManager = BgJobManager (Sem.MSem Int) -- | Type returned by tasks run asynchronously in the background.@@ -799,6 +802,7 @@ where extraMsg t f = "when copying from: " ++ unpack f ++ " to: " ++ unpack t +-- | for 'grep' class PredicateLike pattern hay where match :: pattern -> hay -> Bool
shelly.cabal view
@@ -1,6 +1,6 @@ Name: shelly -Version: 0.8.0.1+Version: 0.8.0.2 Synopsis: shell-like (systems) programming in Haskell Description: Shelly provides a single module for convenient@@ -16,9 +16,7 @@ . * is modern. It uses Text and system-filepath/system-fileio .- * is aimed at convenience and newer Haskell users- .- Shelly is forked from the Shellish package.+ Shelly is originally forked from the Shellish package. Homepage: https://github.com/yesodweb/Shelly.hs