Skip to content

Instantly share code, notes, and snippets.

@bukowa
Created June 25, 2024 15:41
Show Gist options
  • Save bukowa/5df8b249f2d39d955e2d4ca30ba0e124 to your computer and use it in GitHub Desktop.
Save bukowa/5df8b249f2d39d955e2d4ca30ba0e124 to your computer and use it in GitHub Desktop.
jq create arguments from json
# 1. '-b' flag in jq gets rid of the line breaks
# which is problematic on windows CLRF
# 2. '| xargs' after jq is used to trim the extra quotes
# that are problematic when passing the arguments to other
# command into a subshell
# get the arguments for the e2e tests
_get_e2e_args:
#!/bin/bash
jq -b -n -r --slurpfile b .build/.build_data.json \
'
"--tauri_app_binary=\"\($b[0].tauri_app_binary)\"
--tauri_driver_binary=\"\($b[0].tauri_driver_binary)\"
--webdriver_binary=\"\($b[0].webdriver_binary)\""' \
| xargs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment