Skip to content

Commit a6dc457

Browse files
authored
Merge pull request #20 from wader/jaq
Add jaq support
2 parents 482c422 + b3c6edc commit a6dc457

File tree

6 files changed

+274
-190
lines changed

6 files changed

+274
-190
lines changed

.github/workflows/ci.yml

+14-9
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,34 @@ jobs:
1515
- run: |
1616
curl -sOLJ 'https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-amd64'
1717
chmod a+x jq-linux-amd64
18-
make test-jq JQ=./jq-linux-amd64
18+
JQ=./jq-linux-amd64 make test-jq
1919
2020
test-jqjq-jq:
2121
name: Run tests with jqjq using jq
2222
runs-on: ubuntu-latest
2323
steps:
2424
- uses: actions/checkout@v3
25-
# does PATH tricks so that jq that runs invoke_client_jqjq is same jq
2625
- run: |
2726
curl -sOLJ 'https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-amd64'
28-
mv jq-linux-amd64 jq
29-
chmod a+x jq
30-
PATH="$PWD:$PATH" make test-jqjq JQ=jq
27+
chmod a+x jq-linux-amd64
28+
JQ=./jq-linux-amd64 make test-jqjq
3129
3230
test-jqjq-gojq:
3331
name: Run tests with jqjq using gojq
3432
runs-on: ubuntu-latest
3533
steps:
3634
- uses: actions/checkout@v3
3735
- run: |
38-
curl -sOLJ 'https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-amd64'
39-
mv jq-linux-amd64 jq
40-
chmod a+x jq
4136
curl -Ls 'https://github.com/itchyny/gojq/releases/download/v0.12.16/gojq_v0.12.16_linux_amd64.tar.gz' | tar xz
4237
mv gojq*/gojq gojq
43-
PATH="$PWD:$PATH" make test-jqjq JQ=gojq
38+
JQ=./gojq make test-jqjq
39+
40+
test-jqjq-jaq:
41+
name: Run tests with jqjq using jaq
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/checkout@v3
45+
- run: |
46+
curl -sOLJ 'https://github.com/01mf02/jaq/releases/download/v2.0.0-epsilon/jaq-x86_64-unknown-linux-gnu'
47+
chmod a+x jaq-x86_64-unknown-linux-gnu
48+
JQ=./jaq-x86_64-unknown-linux-gnu make test-jqjq

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
JQ=jq
1+
JQ ?= jq
22

33
test: test-jq test-jqjq
44

@@ -8,4 +8,4 @@ test-jq:
88

99
.PHONY: test-jqjq
1010
test-jqjq:
11-
./jqjq --jq "${JQ}" --run-tests < jqjq.test
11+
./jqjq --run-tests < jqjq.test

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,7 @@ Note that the tests are meant to be used with jq 1.7.1.
242242
- [x] gojq
243243
- [x] jqjq
244244
- Used to work but runs out of memory on my laptop
245-
- [ ] jaq
246-
- Fails on missing destructing support
245+
- [x] jaq
247246
- [ ] xq
248247
- Fails on missing `debug`, maths, jqjq `lex` returns empty (regexp issues?)
249248
- [x] Bugs

jqjq

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22
eval "$(
3-
jq \
3+
"${JQ:=jq}" \
44
-nr \
55
-L "$(dirname "$(realpath "${BASH_SOURCE[0]}")")" \
66
'include "jqjq"; $ARGS.positional | invoke_client_jqjq' \

0 commit comments

Comments
 (0)