Compare commits

..

No commits in common. "0fc052efe05a19dd4c2021ca6b80184dfdf57d3a" and "bb9d1a237c0f908c9c3857d914700ac9abbfe1ff" have entirely different histories.

2 changed files with 4 additions and 17 deletions

View File

@ -44,13 +44,6 @@ if __name__ == "__main__":
- [ ] xargs (only prints) - [ ] xargs (only prints)
- [x] shell commands (no stderr capture) - [x] shell commands (no stderr capture)
- [x] jq via bindings - [x] jq via bindings
- [ ] grep
- [ ] head/tail - [ ] head/tail
- [ ] sort - [ ] sort
- [ ] basic shell loops - [ ] basic shell loops
- [ ] shell globs
- [ ] file operations (mv, cp, rm, ls)
- [ ] cat
- [ ] sed
- [ ] trim
- [ ] subshell

View File

@ -98,16 +98,10 @@ class JqMapper(AbstractMapper):
return ["json", "bytes"] return ["json", "bytes"]
def generate(self, input_name: str, output_formats: List[str]) -> ShellMapping: def generate(self, input_name: str, output_formats: List[str]) -> ShellMapping:
if self._parsed.raw_output: # TODO: remove join hack with proper datatype analysis
# TODO: remove join hack with proper datatype analysis code = dedent(f"""\
code = dedent(f"""\ filtered = "\\n".join(jq.all({self._parsed.filter!r}, text={input_name}))
filtered = "\\n".join(jq.all({self._parsed.filter!r}, text={input_name})) """)
""")
else:
code = dedent(f"""\
filtered = jq.text({self._parsed.filter!r}, text={input_name})
""")
return ShellMapping(code=code, output_name="filtered", output_format="str", input_format="", imports=["import jq"]) return ShellMapping(code=code, output_name="filtered", output_format="str", input_format="", imports=["import jq"])