Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a check mode #49

Open
mmhat opened this issue Aug 13, 2024 · 1 comment
Open

Add a check mode #49

mmhat opened this issue Aug 13, 2024 · 1 comment

Comments

@mmhat
Copy link
Contributor

mmhat commented Aug 13, 2024

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:

$ 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...

@Kleidukos
Copy link
Owner

Oh that's hacky indeed, jq provides a contains() filter for you already:

❯ get-tested *.cabal
["9.6.6","9.8.2","9.10.1"]

❯ get-tested *.cabal | jq 'contains(["9.10.1"])'
true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants