shell-monad 0.6.6 → 0.6.7
raw patch · 4 files changed
+17/−2 lines, 4 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Control.Monad.Shell: instance (f ~ ()) => Control.Monad.Shell.CmdParams (Control.Monad.Shell.Script f)
- Control.Monad.Shell: instance Control.Monad.Shell.NameHinted (GHC.Base.Maybe Data.Text.Internal.Lazy.Text)
+ Control.Monad.Shell: instance (f Data.Type.Equality.~ ()) => Control.Monad.Shell.CmdParams (Control.Monad.Shell.Script f)
+ Control.Monad.Shell: instance Control.Monad.Shell.NameHinted (GHC.Maybe.Maybe Data.Text.Internal.Lazy.Text)
- Control.Monad.Shell: AStatic :: (Term Static Integer) -> Arith
+ Control.Monad.Shell: AStatic :: Term Static Integer -> Arith
- Control.Monad.Shell: AVar :: (Term Var Integer) -> Arith
+ Control.Monad.Shell: AVar :: Term Var Integer -> Arith
- Control.Monad.Shell: Output :: (Script ()) -> Output
+ Control.Monad.Shell: Output :: Script () -> Output
- Control.Monad.Shell: WithVar :: (Term Var a) -> (Quoted Text -> Quoted Text) -> WithVar a
+ Control.Monad.Shell: WithVar :: Term Var a -> (Quoted Text -> Quoted Text) -> WithVar a
- Control.Monad.Shell: [TBlockExists] :: (Param p) => p -> Test
+ Control.Monad.Shell: [TBlockExists] :: Param p => p -> Test
- Control.Monad.Shell: [TCharExists] :: (Param p) => p -> Test
+ Control.Monad.Shell: [TCharExists] :: Param p => p -> Test
- Control.Monad.Shell: [TDirExists] :: (Param p) => p -> Test
+ Control.Monad.Shell: [TDirExists] :: Param p => p -> Test
- Control.Monad.Shell: [TEmpty] :: (Param p) => p -> Test
+ Control.Monad.Shell: [TEmpty] :: Param p => p -> Test
- Control.Monad.Shell: [TFileExecutable] :: (Param p) => p -> Test
+ Control.Monad.Shell: [TFileExecutable] :: Param p => p -> Test
- Control.Monad.Shell: [TFileExists] :: (Param p) => p -> Test
+ Control.Monad.Shell: [TFileExists] :: Param p => p -> Test
- Control.Monad.Shell: [TFileNonEmpty] :: (Param p) => p -> Test
+ Control.Monad.Shell: [TFileNonEmpty] :: Param p => p -> Test
- Control.Monad.Shell: [TNonEmpty] :: (Param p) => p -> Test
+ Control.Monad.Shell: [TNonEmpty] :: Param p => p -> Test
- Control.Monad.Shell: [TRegularFileExists] :: (Param p) => p -> Test
+ Control.Monad.Shell: [TRegularFileExists] :: Param p => p -> Test
- Control.Monad.Shell: [TSymlinkExists] :: (Param p) => p -> Test
+ Control.Monad.Shell: [TSymlinkExists] :: Param p => p -> Test
- Control.Monad.Shell: defaultVar :: (Param param) => forall a. Term Var a -> param -> Script (Term Var a)
+ Control.Monad.Shell: defaultVar :: Param param => forall a. Term Var a -> param -> Script (Term Var a)
- Control.Monad.Shell: errUnlessVar :: (Param param) => forall a. Term Var a -> param -> Script (Term Var a)
+ Control.Monad.Shell: errUnlessVar :: Param param => forall a. Term Var a -> param -> Script (Term Var a)
- Control.Monad.Shell: newVar :: (NameHinted namehint) => forall a. namehint -> Script (Term Var a)
+ Control.Monad.Shell: newVar :: NameHinted namehint => forall a. namehint -> Script (Term Var a)
- Control.Monad.Shell: static :: (Quotable (Val t)) => t -> Term Static t
+ Control.Monad.Shell: static :: Quotable (Val t) => t -> Term Static t
- Control.Monad.Shell: takeParameter :: (NameHinted namehint) => forall a. namehint -> Script (Term Var a)
+ Control.Monad.Shell: takeParameter :: NameHinted namehint => forall a. namehint -> Script (Term Var a)
- Control.Monad.Shell: whenVar :: (Param param) => forall a. Term Var a -> param -> Script (Term Var a)
+ Control.Monad.Shell: whenVar :: Param param => forall a. Term Var a -> param -> Script (Term Var a)
Files
- CHANGELOG +6/−0
- Control/Monad/Shell/Quote.hs +5/−1
- examples/hello.hs +5/−0
- shell-monad.cabal +1/−1
CHANGELOG view
@@ -1,3 +1,9 @@+shell-monad (0.6.7) unstable; urgency=medium++ * Fix quoting of empty String/Text.++ -- Joey Hess <id@joeyh.name> Sat, 22 Dec 2018 16:35:48 -0400+ shell-monad (0.6.6) unstable; urgency=medium * Improvements to build with base-4.12 (MonadFail).
Control/Monad/Shell/Quote.hs view
@@ -30,15 +30,19 @@ -- The method used is to replace ' with '"'"' and wrap the value inside -- single quotes. This works for POSIX shells, as well as other shells -- like csh.+--+-- The single quotes are omitted for simple values that do not need+-- any quoting. class Quotable t where quote :: t -> Quoted L.Text instance Quotable L.Text where quote t- | L.all (\c -> isAlphaNum c || c == '_') t = Q t+ | L.all bareable t && L.any bareable t = Q t | otherwise = Q $ q <> L.intercalate "'\"'\"'" (L.splitOn q t) <> q where q = "'"+ bareable c = isAlphaNum c || c == '_' instance Quotable String where quote = quote . L.pack
examples/hello.hs view
@@ -10,3 +10,8 @@ cmd "echo" "hello, world" username <- newVarFrom (Output (cmd "whoami")) () cmd "echo" "from" (WithVar username (<> "'s shell"))++ v <- globalVar "SOMEVAR"+ ifCmd (test $ TStrEqual v "")+ (cmd "echo" "Bad")+ (cmd "echo" "Good")
shell-monad.cabal view
@@ -1,5 +1,5 @@ Name: shell-monad-Version: 0.6.6+Version: 0.6.7 Cabal-Version: >= 1.8 License: BSD3 Maintainer: Joey Hess <id@joeyh.name>