added utility scripts to make publishing books easier
[project-aon.git] / common / scripts / list-bookcodes-all.sh
diff --git a/common/scripts/list-bookcodes-all.sh b/common/scripts/list-bookcodes-all.sh
new file mode 100755 (executable)
index 0000000..043835b
--- /dev/null
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+#
+# List all bookcodes.
+
+if [ ! -d "$AONDIR" ]; then
+    >&2 echo "Please set the AONDIR environment variable"
+    exit
+fi
+
+book_db="$AONDIR/common/sqlite/bookcodes.db"
+
+sqlite3 -column -noheader "$book_db" "select book from bookcodes order by book"