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

Refactor to remove Python script #4

Open
morgante opened this issue Sep 10, 2020 · 1 comment
Open

Refactor to remove Python script #4

morgante opened this issue Sep 10, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request P3 medium priority issues triaged Scoped and ready for work

Comments

@morgante
Copy link
Contributor

Currently the scripts depend on Python for string manipulation.

We should either:

  1. Replace the Python logic with jq (to stick to shell utils)
  2. Replace the shell scripts with full Python scripts.
@morgante morgante added the enhancement New feature or request label Sep 10, 2020
@yuryu yuryu mentioned this issue Sep 29, 2021
@g-awmalik g-awmalik self-assigned this Aug 5, 2022
@g-awmalik g-awmalik added triaged Scoped and ready for work P3 medium priority issues labels Aug 5, 2022
@black-snow
Copy link

black-snow commented Sep 20, 2022

Turning a JSON array into a list of escaped shell args jq -r 'map("\"" + . + "\"") | join(",")' should do:

> echo '["a", "b", "cd ef", "$d"]' | jq -r 'map("\"" + . + "\"") | join(" ")'
"a" "b" "cd ef" "$d"

/edit: oh, apparently no escaping but comma-separation is required: jq -r '. | join(",")'

> echo '["a", "b", "cd ef", "$d"]' | jq -r '. | join(",")'
a,b,cd ef,$d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P3 medium priority issues triaged Scoped and ready for work
Projects
None yet
Development

No branches or pull requests

3 participants