remove trailing newline from input
This commit is contained in:
parent
b462b6a54f
commit
047582f91e
5
orcli
5
orcli
|
@ -1777,10 +1777,13 @@ orcli_export_template_command() {
|
|||
fi
|
||||
fi
|
||||
|
||||
# read args[file] into variable to remove trailing newline
|
||||
template=$(cat "${args[file]}")
|
||||
|
||||
# assemble specific post data
|
||||
data+=("project=${projectid}")
|
||||
data+=("format=template")
|
||||
data+=("template@${args[file]}")
|
||||
data+=("template=${template}")
|
||||
if [[ ${args[--prefix]} ]]; then
|
||||
data+=("prefix=${args[--prefix]}")
|
||||
fi
|
||||
|
|
|
@ -29,10 +29,13 @@ else
|
|||
fi
|
||||
fi
|
||||
|
||||
# read args[file] into variable to remove trailing newline
|
||||
template=$(cat "${args[file]}")
|
||||
|
||||
# assemble specific post data
|
||||
data+=("project=${projectid}")
|
||||
data+=("format=template")
|
||||
data+=("template@${args[file]}")
|
||||
data+=("template=${template}")
|
||||
if [[ ${args[--prefix]} ]]; then
|
||||
data+=("prefix=${args[--prefix]}")
|
||||
fi
|
||||
|
|
|
@ -12,9 +12,7 @@ cp data/duplicates.csv "${tmpdir}/${t}.csv"
|
|||
|
||||
# assertion
|
||||
cat << "DATA" > "${tmpdir}/${t}.assert"
|
||||
{ "events" : [{ "name" : "Ben Tyler", "purchase" : "Flashlight" }
|
||||
,{ "name" : "Ben Morisson", "purchase" : "Amplifier" }
|
||||
]}
|
||||
{ "events" : [{ "name" : "Ben Tyler", "purchase" : "Flashlight" },{ "name" : "Ben Morisson", "purchase" : "Amplifier" }]}
|
||||
DATA
|
||||
|
||||
# action
|
||||
|
@ -24,7 +22,7 @@ orcli export template "${t}" --output "${t}.output" \
|
|||
<<< '{ "name" : {{jsonize(cells["name"].value)}}, "purchase" : {{jsonize(cells["purchase"].value)}} }' \
|
||||
--prefix '{ "events" : [' \
|
||||
--separator , \
|
||||
--mode rows \
|
||||
--mode records \
|
||||
--suffix ]}$'\n' \
|
||||
--facets '[ { "type": "text", "name": "foo", "columnName": "name", "mode": "regex", "caseSensitive": false, "query": "Ben" } ]'
|
||||
|
||||
|
|
Loading…
Reference in New Issue