|
1 | 1 | #!/usr/bin/env bash |
2 | | -# This script was generated by bashly 1.1.1 (https://bashly.dannyb.co) |
| 2 | +# This script was generated by bashly 1.1.2 (https://bashly.dannyb.co) |
3 | 3 | # Modifying it manually is not recommended |
4 | 4 |
|
5 | 5 | # :wrapper.bash3_bouncer |
@@ -2231,7 +2231,8 @@ orcli_transform_command() { |
2231 | 2231 | fi |
2232 | 2232 | for line in "${jsonlines[@]}"; do |
2233 | 2233 | # parse one line/operation into array |
2234 | | - declare -A array="($(echo "$line" | jq -r 'to_entries | map("[\(.key)]=" + @sh "\(.value|tostring)") | .[]'))" |
| 2234 | + filter='[to_entries[]|"["+(.key|@sh)+"]="+(.value|tostring|@sh)]|"("+join(" ")+")"' |
| 2235 | + declare -A array=$(jq --join-output "${filter}" <<< "$line") |
2235 | 2236 | if [[ ! ${array[op]} ]]; then |
2236 | 2237 | error "parsing ${files[$i]} failed!" |
2237 | 2238 | fi |
@@ -2259,6 +2260,8 @@ orcli_transform_command() { |
2259 | 2260 | unset "array[engineConfig]" |
2260 | 2261 | # drop description |
2261 | 2262 | unset "array[description]" |
| 2263 | + # remove line breaks in expression |
| 2264 | + array[expression]="${array[expression]//$'\n'/}" |
2262 | 2265 | # prepare curl options |
2263 | 2266 | mapfile -t curloptions < <(for K in "${!array[@]}"; do |
2264 | 2267 | echo "--data" |
@@ -4305,7 +4308,7 @@ orcli_export_jsonl_parse_requirements() { |
4305 | 4308 | [[ -n ${args['--encoding']:-} ]] || args['--encoding']="UTF-8" |
4306 | 4309 |
|
4307 | 4310 | # :command.whitelist_filter |
4308 | | - if [[ ${args['--mode']} ]] && [[ ! ${args['--mode']} =~ ^(rows|records)$ ]]; then |
| 4311 | + if [[ ${args['--mode']:-} ]] && [[ ! ${args['--mode']:-} =~ ^(rows|records)$ ]]; then |
4309 | 4312 | printf "%s\n" "--mode must be one of: rows, records" >&2 |
4310 | 4313 | exit 1 |
4311 | 4314 | fi |
@@ -4454,7 +4457,7 @@ orcli_export_tsv_parse_requirements() { |
4454 | 4457 | [[ -n ${args['--encoding']:-} ]] || args['--encoding']="UTF-8" |
4455 | 4458 |
|
4456 | 4459 | # :command.whitelist_filter |
4457 | | - if [[ ${args['--mode']} ]] && [[ ! ${args['--mode']} =~ ^(rows|records)$ ]]; then |
| 4460 | + if [[ ${args['--mode']:-} ]] && [[ ! ${args['--mode']:-} =~ ^(rows|records)$ ]]; then |
4458 | 4461 | printf "%s\n" "--mode must be one of: rows, records" >&2 |
4459 | 4462 | exit 1 |
4460 | 4463 | fi |
@@ -4638,7 +4641,7 @@ orcli_export_template_parse_requirements() { |
4638 | 4641 | [[ -n ${args['--encoding']:-} ]] || args['--encoding']="UTF-8" |
4639 | 4642 |
|
4640 | 4643 | # :command.whitelist_filter |
4641 | | - if [[ ${args['--mode']} ]] && [[ ! ${args['--mode']} =~ ^(rows|records)$ ]]; then |
| 4644 | + if [[ ${args['--mode']:-} ]] && [[ ! ${args['--mode']:-} =~ ^(rows|records)$ ]]; then |
4642 | 4645 | printf "%s\n" "--mode must be one of: rows, records" >&2 |
4643 | 4646 | exit 1 |
4644 | 4647 | fi |
@@ -4747,7 +4750,7 @@ orcli_run_parse_requirements() { |
4747 | 4750 |
|
4748 | 4751 | # :command.initialize |
4749 | 4752 | initialize() { |
4750 | | - version="0.2.0" |
| 4753 | + version="0.2.1" |
4751 | 4754 | long_usage='' |
4752 | 4755 | set -e |
4753 | 4756 |
|
|
0 commit comments