Open mmhat opened 2 months ago
Is it possible to have a check mode, that tells you whether a given GHC version is in the get-tested stanza of a Cabal file or not? What I mean is something like this:
check
get-tested
$ get-tested get-tested.cabal ["9.10.1"] $ get-tested check get-tested.cabal 9.10.1; echo $? 0 $ get-tested check get-tested.cabal 9.8.2; echo $? 1 $ get-tested check get-tested.cabal 9.8.2 9.10.1; echo $? 1
I know I can work around that (e.g. get-tested get-tested.cabal | jq --raw-output '.[]' | grep -q '9.10.1'), but that's rather hacky...
get-tested get-tested.cabal | jq --raw-output '.[]' | grep -q '9.10.1'
Oh that's hacky indeed, jq provides a contains() filter for you already:
jq
contains()
❯ get-tested *.cabal ["9.6.6","9.8.2","9.10.1"] ❯ get-tested *.cabal | jq 'contains(["9.10.1"])' true
Is it possible to have a
check
mode, that tells you whether a given GHC version is in theget-tested
stanza of a Cabal file or not? What I mean is something like this:I know I can work around that (e.g.
get-tested get-tested.cabal | jq --raw-output '.[]' | grep -q '9.10.1'
), but that's rather hacky...