2022-11-30 22:49:54 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-12-03 00:30:01 +00:00
|
|
|
t="import-csv"
|
2022-11-30 22:49:54 +00:00
|
|
|
|
2022-12-03 23:39:53 +00:00
|
|
|
# create tmp directory
|
2022-12-03 00:30:01 +00:00
|
|
|
tmpdir="$(mktemp -d)"
|
|
|
|
trap '{ rm -rf "${tmpdir}"; }' 0 2 3 15
|
2022-12-03 23:39:53 +00:00
|
|
|
|
|
|
|
# input
|
|
|
|
cp data/example.csv "${tmpdir}/${t}.csv"
|
|
|
|
|
|
|
|
# assertion
|
|
|
|
cp data/example.tsv "${tmpdir}/${t}.assert"
|
2022-11-30 22:49:54 +00:00
|
|
|
|
|
|
|
# action
|
2022-12-03 23:39:53 +00:00
|
|
|
cd "${tmpdir}" || exit 1
|
2023-01-12 10:18:06 +00:00
|
|
|
orcli import csv "${t}.csv" --projectName "${t}"
|
|
|
|
orcli export tsv "${t}" > "${t}.output"
|
2022-11-30 22:49:54 +00:00
|
|
|
|
|
|
|
# test
|
2022-12-03 00:30:01 +00:00
|
|
|
diff -u "${t}.assert" "${t}.output"
|