-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding `jq` stage to `fud2` but I've been having trouble getting the stage to print out the value from the command. It seems like the `jq ... > $out` call gobbles up the output. Not sure if I'm making a mistake. Any thoughts @EclecticGriffin @ekiwi or @sampsyo?
- Loading branch information
1 parent
d87b1a2
commit 6b48969
Showing
6 changed files
with
78 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import "rtl_sim" as sim; | ||
|
||
export const jq_state = state("jq", ["jq"]); | ||
|
||
defop dat_to_jq(json: sim::dat) >> out: jq_state { | ||
let expr = config_or("jq.expr", "."); | ||
let jq = config_or("jq.exe", "jq"); | ||
let flags = config_or("jq.flags", ""); | ||
|
||
shell(`${jq} '${expr}' ${flags} ${json} > ${out}`); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
source: fud2/tests/tests.rs | ||
description: "emit plan: dat_to_jq" | ||
--- | ||
build-tool = fud2 | ||
rule get-rsrc | ||
command = $build-tool get-rsrc $out | ||
|
||
jq.expr = . | ||
jq.exe = jq | ||
jq.flags = | ||
rule dat_to_jq_rule_1 | ||
command = ${jq.exe} '${jq.expr}' ${jq.flags} $i0 > $o0 | ||
build _dat_to_jq_rule_1.fake $o0: dat_to_jq_rule_1 $i0 | ||
i0 = /input.ext | ||
o0 = /output.ext | ||
|
||
|
||
default /output.ext |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters