shh 0.7.2.2 → 0.7.3.0
raw patch · 6 files changed
+27/−29 lines, 6 filesdep −doctestdep ~basedep ~containersdep ~deepseqsetup-changedPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependencies removed: doctest
Dependency ranges changed: base, containers, deepseq, filepath, template-haskell
API changes (from Hackage documentation)
- Shh.Internal: instance Shh.Internal.Command [Data.ByteString.Internal.ByteString]
- Shh.Internal: instance Shh.Internal.ExecArg Data.ByteString.Internal.ByteString
- Shh.Internal: instance Shh.Internal.ToFilePath Data.ByteString.Internal.ByteString
+ Shh.Internal: instance Shh.Internal.Command [Data.ByteString.Internal.Type.ByteString]
+ Shh.Internal: instance Shh.Internal.ExecArg Data.ByteString.Internal.Type.ByteString
+ Shh.Internal: instance Shh.Internal.ToFilePath Data.ByteString.Internal.Type.ByteString
Files
- ChangeLog.md +4/−0
- Setup.hs +2/−2
- app/shh-app.hs +17/−16
- shh.cabal +3/−7
- src/Shh/Internal.hs +1/−1
- test/Test.hs +0/−3
ChangeLog.md view
@@ -1,5 +1,9 @@ # Revision history for shh +## 0.7.3.0 -- 2023-12-19++* Add a `--debug` flag, and default to being less noisy on startup.+ ## 0.7.1.4 -- 2021-07-01 * Fix a bug where `|>` was too strict, causing SIGPIPE
Setup.hs view
@@ -1,2 +1,2 @@-import Distribution.Extra.Doctest-main = defaultMainWithDoctests "shh-tests"+import Distribution.Simple+main = defaultMain
app/shh-app.hs view
@@ -38,8 +38,6 @@ \exec \"$@\"\n\ \" -debug = putStrLn- doIfMissing :: FilePath -> IO () -> IO () doIfMissing fp a = do doesFileExist fp >>= \case@@ -62,20 +60,23 @@ wrapper :: String wrapper = shhDir <> "/wrapper" - debug $ "Shh home is: " <> shhDir+ let debug = elem "--debug" a+ when debug $ putStrLn $ "Shh home is: " <> shhDir + case a of+ ["--rebuild"] -> do+ removeFile "Shell.hi"+ removeFile "Shell.o"+ ["--help"] -> do+ putStrLn "usage: shh [--rebuild][--debug]"+ exitSuccess+ ["--debug"] -> pure ()+ [] -> pure ()+ _ -> error $ "Unknown arguments: " ++ show a+ createDirectoryIfMissing False shhDir withCurrentDirectory shhDir $ do- case a of- ["--rebuild"] -> do- removeFile "Shell.hi"- removeFile "Shell.o"- [] -> pure ()- ["--help"] -> do- putStrLn "usage: shh [--rebuild]"- exitSuccess- _ -> error $ "Unknown arguments: " ++ show a writeIfMissing "wrapper" defaultWrapper setPermissions "wrapper" $ setOwnerExecutable True $@@ -85,7 +86,7 @@ doIfMissing "init.ghci" $ do putStrLn "Generating init.ghci..." putStrLn " ... checking for shh..."- tryFailure (exe (pack wrapper) "ghc" "-e" "import Shh") >>= \case+ tryFailure (exe (pack wrapper) "ghc" (if debug then "" else "-v0") "-e" "import Shh") >>= \case Left _ -> do putStrLn "Please make the shh and shh-extras packages available in the shh" putStrLn "environment (install it globally or modify the wrapper, see docs)."@@ -93,7 +94,7 @@ exitFailure Right _ -> writeFile "init.ghci" defaultInitGhci putStrLn " ... checking for shh-extras..."- tryFailure (exe (pack wrapper) "ghc" "-e" "import Shh.Prompt") >>= \case+ tryFailure (exe (pack wrapper) "ghc" (if debug then "" else "-v0") "-e" "import Shh.Prompt") >>= \case Left _ -> do putStrLn "## WARNING ##########################################################" putStrLn "# You do not have the shh-extras library installed, and so we are"@@ -116,7 +117,7 @@ putStrLn "Rebuilding Shell.hs..." writeFile "paths" cp -- Use absolute path of Shell.hs so that GHCi doesn't recompile.- exe (pack wrapper) "ghc" "-c" "-dynamic" (shhDir <> "/Shell.hs")+ exe (pack wrapper) "ghc" "-c" "-dynamic" (shhDir <> "/Shell.hs") (if debug then "" else "-v0") - executeFile wrapper False ["ghci", "-ghci-script", shhDir <> "/init.ghci", shhDir <> "/Shell.hs"] Nothing+ executeFile wrapper False (["ghci", "-ghci-script", shhDir <> "/init.ghci", shhDir <> "/Shell.hs"] <> if debug then [] else ["-v0"]) Nothing
shh.cabal view
@@ -1,5 +1,5 @@ name: shh-version: 0.7.2.2+version: 0.7.3.0 synopsis: Simple shell scripting from Haskell description: Provides a shell scripting environment for Haskell. It helps you use external binaries, and allows you to@@ -17,9 +17,8 @@ custom-setup setup-depends:- base <4.18- , Cabal <3.11- , cabal-doctest >=1.0.9 && <1.1+ base <4.18,+ Cabal <3.11 source-repository head type: git@@ -80,7 +79,6 @@ async, bytestring, directory,- doctest, filepath, PyF, tasty,@@ -93,5 +91,3 @@ main-is: Test.hs other-modules: Readme type: exitcode-stdio-1.0- other-modules: Build_doctests- autogen-modules: Build_doctests
src/Shh/Internal.hs view
@@ -528,7 +528,7 @@ captureEndBy0 :: Shell io => io [ByteString] captureEndBy0 = captureEndBy "\0" --- | Same as @'captureSplit' "\\n"@.+-- | Same as @'captureEndBy' "\\n"@. captureLines :: Shell io => io [ByteString] captureLines = captureEndBy "\n"
test/Test.hs view
@@ -9,7 +9,6 @@ import qualified Data.ByteString.Lazy as BS import Data.ByteString.Lazy.UTF8 (toString, fromString) import qualified Data.ByteString.Lazy.Char8 as C8-import Test.DocTest import Test.Tasty import Test.Tasty.HUnit import Test.Tasty.QuickCheck@@ -22,7 +21,6 @@ import System.IO import System.Environment -import Build_doctests (flags, pkgs, module_sources) import Readme load SearchPath@@ -38,7 +36,6 @@ putStrLn " they are missing." putStrLn "################################################" unsetEnv "GHC_ENVIRONMENT"- doctest $ flags ++ pkgs ++ module_sources defaultMain tests tests :: TestTree