aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorJoris2023-09-12 22:45:16 +0200
committerJoris2023-09-12 22:45:16 +0200
commitc8ffa6722ef948879fa6ed9642ad134a2193fa4b (patch)
tree06742ecb6f838af6f0a44344505bd5fc11b24397 /bin
parent941e8eb10c7e9cef883fbbc283f154f3312f0f9b (diff)
Write metadata in TOML
Diffstat (limited to 'bin')
-rwxr-xr-xbin/get-books9
1 files changed, 5 insertions, 4 deletions
diff --git a/bin/get-books b/bin/get-books
index d3ac0f6..1c9bf67 100755
--- a/bin/get-books
+++ b/bin/get-books
@@ -11,13 +11,14 @@ fi
echo "const bookLibrary = ["
-for METADATA in $(find "$BOOK_DIR" -name 'metadata.json'); do
+for METADATA in $(find "$BOOK_DIR" -name 'metadata.toml'); do
DIR=$(dirname "$METADATA")
COVER=$(ls $DIR/cover.*)
- cat "$METADATA" | head -n -1
- echo ", \"cover\": \"$COVER\""
- echo "},"
+ TOML=$(cat "$METADATA")
+ WITH_COVER=$(echo -e "$TOML\ncover = \"$COVER\"")
+ echo "$WITH_COVER" | toml2json
+ echo ","
done
echo "]"