mirror of
https://github.com/kowainik/shellmet.git
synced 2024-10-05 13:37:34 +03:00
parent
9fb7d02c13
commit
928f56359b
8
.github/workflows/ci.yml
vendored
8
.github/workflows/ci.yml
vendored
@ -18,11 +18,11 @@ jobs:
|
||||
- "8.2.2"
|
||||
- "8.4.4"
|
||||
- "8.6.5"
|
||||
- "8.8.3"
|
||||
- "8.10.1"
|
||||
- "8.8.4"
|
||||
- "8.10.2"
|
||||
exclude:
|
||||
- os: macOS-latest
|
||||
ghc: 8.8.3
|
||||
ghc: 8.8.4
|
||||
- os: macOS-latest
|
||||
ghc: 8.6.5
|
||||
- os: macOS-latest
|
||||
@ -62,7 +62,7 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
stack: ["2.1.3"]
|
||||
ghc: ["8.8.3"]
|
||||
ghc: ["8.10.2"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
@ -3,6 +3,12 @@
|
||||
`shellmet` uses [PVP Versioning][1].
|
||||
The changelog is available [on GitHub][2].
|
||||
|
||||
## Unreleased
|
||||
|
||||
* [#20](https://github.com/kowainik/shellmet/issues/20):
|
||||
Add `isSuccess` function to show if the command succeded.
|
||||
* Upgrade GHC from `8.8.3` to `8.8.4`, `8.10.1` to `8.10.2`.
|
||||
|
||||
## 0.0.3.1 — May 7, 2020
|
||||
|
||||
* [#18](https://github.com/kowainik/shellmet/issues/18):
|
||||
|
@ -17,8 +17,8 @@ extra-doc-files: README.md
|
||||
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.2
|
||||
|
||||
source-repository head
|
||||
type: git
|
||||
|
@ -20,6 +20,7 @@ module Shellmet
|
||||
( ($|)
|
||||
, ($^)
|
||||
, ($?)
|
||||
, isSuccess
|
||||
) where
|
||||
|
||||
import Control.Exception (catch)
|
||||
@ -80,3 +81,13 @@ infixl 4 $?
|
||||
($?) :: 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
|
||||
|
@ -1 +1 @@
|
||||
resolver: lts-15.11
|
||||
resolver: nightly-2020-08-30
|
||||
|
Loading…
Reference in New Issue
Block a user