feat: add docfill mvp cli
This commit is contained in:
31
scripts/smoke.sh
Executable file
31
scripts/smoke.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
TMP="$(mktemp -d "${TMPDIR:-/tmp}/docfill-smoke.XXXXXX")"
|
||||
cleanup() {
|
||||
rm -rf "$TMP"
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
cd "$ROOT"
|
||||
|
||||
go test -count=1 ./...
|
||||
go build -o "$TMP/docfill" ./cmd/docfill
|
||||
|
||||
cp -R examples "$TMP/examples"
|
||||
go run ./scripts/smoke-fixtures --base "$TMP/examples"
|
||||
|
||||
"$TMP/docfill" run -c "$TMP/examples/excel-to-word/task.json" --var date=2026-06-18
|
||||
"$TMP/docfill" run -c "$TMP/examples/sqlite-to-excel/task.json" --var date=2026-06-18
|
||||
|
||||
test -f "$TMP/examples/excel-to-word/out/daily_2026-06-18_张三_1.docx"
|
||||
test -f "$TMP/examples/excel-to-word/out/daily_2026-06-18_李四_2.docx"
|
||||
|
||||
xlsx_count="$(find "$TMP/examples/sqlite-to-excel/out" -type f -name '*.xlsx' | wc -l | tr -d ' ')"
|
||||
if [[ "$xlsx_count" != "2" ]]; then
|
||||
echo "expected 2 sqlite-to-excel outputs, got $xlsx_count" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "smoke ok"
|
||||
Reference in New Issue
Block a user