1
1
mirror of https://github.com/mgree/ffs.git synced 2024-09-11 11:15:48 +03:00
ffs/tests/override_infer.sh
Michael Greenberg b48efc266c
Support other formats. (#11)
Broad refactor of how things work, moving `json.rs` to `format.rs`.

Adds support for TOML, along with CLI stuff for setting formats (which are automatically inferred from filenames).

Adds support for binary data using base64 encodings.
2021-06-20 18:20:06 -07:00

33 lines
498 B
Bash
Executable File

#!/bin/sh
fail() {
echo FAILED: $1
if [ "$MNT" ]
then
cd
umount "$MNT"
rmdir "$MNT"
rm "$SRC" "$TGT"
fi
exit 1
}
MNT=$(mktemp -d)
SRC=$(mktemp)
TGT=$(mktemp)
cp ../toml/single.toml "$SRC"
ffs --source toml --target json -o "$TGT" "$MNT" "$SRC" &
PID=$!
sleep 2
umount "$MNT" || fail unmount1
sleep 1
kill -0 $PID >/dev/null 2>&1 && fail process1
diff "$TGT" ../json/single.json || fail diff
rmdir "$MNT" || fail mount
rm "$SRC" "$TGT"