aboutsummaryrefslogtreecommitdiff
path: root/bin/get-books
diff options
context:
space:
mode:
Diffstat (limited to 'bin/get-books')
-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 "]"