shellmet 0.0.3.1 → 0.0.4.0
raw patch · 3 files changed
+31/−8 lines, 3 filesdep ~basenew-uploader
Dependency ranges changed: base
Files
- CHANGELOG.md +8/−0
- shellmet.cabal +6/−5
- src/Shellmet.hs +17/−3
CHANGELOG.md view
@@ -3,6 +3,14 @@ `shellmet` uses [PVP Versioning][1]. The changelog is available [on GitHub][2]. +## 0.0.4.0 — Mar 23, 2021++* [#20](https://github.com/kowainik/shellmet/issues/20):+ Add `isSuccess` function to show if the command succeded.+* [#25](https://github.com/kowainik/shellmet/issues/25):+ Support GHC-9.0.+* Upgrade GHC from `8.8.3` to `8.8.4`, `8.10.1` to `8.10.4`.+ ## 0.0.3.1 — May 7, 2020 * [#18](https://github.com/kowainik/shellmet/issues/18):
shellmet.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.4 name: shellmet-version: 0.0.3.1+version: 0.0.4.0 synopsis: Out of the shell solution for scripting in Haskell description: Shellmet provides easy and convenient way to call shell commands from Haskell programs homepage: https://github.com/kowainik/shellmet@@ -9,7 +9,7 @@ license-file: LICENSE author: Dmitrii Kovanikov maintainer: Kowainik <xrom.xkov@gmail.com>-copyright: 2019-2020 Kowainik+copyright: 2019-2021 Kowainik category: Shell, Command Line build-type: Simple extra-doc-files: README.md@@ -17,15 +17,16 @@ tested-with: GHC == 8.2.2 GHC == 8.4.4 GHC == 8.6.5- GHC == 8.8.3- GHC == 8.10.1+ GHC == 8.8.4+ GHC == 8.10.4+ GHC == 9.0.1 source-repository head type: git location: https://github.com/kowainik/shellmet.git common common-options- build-depends: base >= 4.10.1.0 && < 4.15+ build-depends: base >= 4.10.1.0 && < 4.16 ghc-options: -Wall -Wcompat
src/Shellmet.hs view
@@ -4,9 +4,12 @@ {-# LANGUAGE TypeFamilies #-} {- |-Copyright: (c) 2019-2020 Kowainik-SPDX-License-Identifier: MPL-2.0-Maintainer: Kowainik <xrom.xkov@gmail.com>+Module : Shellmet+Copyright : (c) 2019-2021 Kowainik+SPDX-License-Identifier : MPL-2.0+Maintainer : Kowainik <xrom.xkov@gmail.com>+Stability : Stable+Portability : Portable This module contains neat utilities to be able to work with shell commands in generic and simple way using just string literals.@@ -20,6 +23,7 @@ ( ($|) , ($^) , ($?)+ , isSuccess ) where import Control.Exception (catch)@@ -80,3 +84,13 @@ ($?) :: IO a -> IO a -> IO a action $? handler = action `catch` \(_ :: IOError) -> handler {-# INLINE ($?) #-}++{- | Returns the indicator of if the command succeded or not.++>>> isSuccess $ "echo" ["Hello world!"]+⚙ echo 'Hello world!'+Hello world!+True+-}+isSuccess :: IO a -> IO Bool+isSuccess action = (True <$ action) $? pure False