shelly 1.6.3.2 → 1.6.3.3
raw patch · 4 files changed
+29/−11 lines, 4 filesPVP: minor bump suggested
API additions: PVP suggests at least a minor version bump
API changes (from Hackage documentation)
+ Shelly.Unix: kill :: Int -> Sh ()
Files
- README.md +6/−2
- shelly.cabal +3/−3
- src/Shelly.hs +8/−6
- src/Shelly/Unix.hs +12/−0
README.md view
@@ -64,9 +64,13 @@ For some this is an absolutely critical feature, particularly given that Haskell does not yet offer up stack traces. -### Haskell supplements+### Haskell file-finding supplements -* [FileManip](hackage.haskell.org/package/FileManip) - more efficient file finding code (uses Lazy IO). Shelly's finders are currently being re-worked+* [find-conduit](http://hackage.haskell.org/package/find-conduit) - uses conduits, similar speed to GNU find+* [FileManip](hackage.haskell.org/package/FileManip) - uses Lazy IO++Shelly's finders load all files into memory. This is simpler to use if you control the filesystem structure and know the system is bounded in size. However, if the filesystem structure is unbounded it consumes unbounded memory.+ ### Shell commands with richer input/output
shelly.cabal view
@@ -1,6 +1,6 @@ Name: shelly -Version: 1.6.3.2+Version: 1.6.3.3 Synopsis: shell-like (systems) programming in Haskell Description: Shelly provides convenient systems programming in Haskell,@@ -41,7 +41,7 @@ README.md Library- Exposed-modules: Shelly, Shelly.Lifted, Shelly.Pipe+ Exposed-modules: Shelly, Shelly.Lifted, Shelly.Pipe, Shelly.Unix other-modules: Shelly.Base, Shelly.Find hs-source-dirs: src @@ -88,7 +88,7 @@ type: exitcode-stdio-1.0 hs-source-dirs: src test/src main-is: TestMain.hs- ghc-options: -O2 -Wall -fhpc -fwarn-tabs -funbox-strict-fields -threaded+ ghc-options: -O2 -Wall -fwarn-tabs -funbox-strict-fields -threaded -fno-warn-unused-do-bind -fno-warn-type-defaults
src/Shelly.hs view
@@ -1070,14 +1070,16 @@ -- | Like `run`, but it invokes the user-requested program with _bash_, -- setting _pipefail_ appropriately. bash :: FilePath -> [Text] -> Sh Text-bash fp args = escaping False $ do- let sanitise = T.replace "'" "\'" . T.intercalate " "- run "bash" ["-c", "'set -o pipefail && " <> sanitise (toTextIgnore fp : args) <> "'"]+bash fp args = escaping False $ run "bash" $ bashArgs fp args bash_ :: FilePath -> [Text] -> Sh ()-bash_ fp args = escaping False $ do- let sanitise = T.replace "'" "\'" . T.intercalate " "- run_ "bash" ["-c", "'set -o pipefail && " <> sanitise (toTextIgnore fp : args) <> "'"]+bash_ fp args = escaping False $ run_ "bash" $ bashArgs fp args++bashArgs :: FilePath -> [Text] -> [Text]+bashArgs fp args =+ ["-c", "'set -o pipefail; " <> sanitise (toTextIgnore fp : args) <> "'"]+ where+ sanitise = T.replace "'" "\'" . T.intercalate " " -- | bind some arguments to run for re-use. Example: --
+ src/Shelly/Unix.hs view
@@ -0,0 +1,12 @@+{-# LANGUAGE OverloadedStrings #-}++-- | commands that only work on Unix+module Shelly.Unix+ ( kill+ ) where++import Shelly+import qualified Data.Text as T++kill :: Int -> Sh ()+kill pid = run_ "kill" ["-15", T.pack $ show pid]