Project Aon Git Repositories
/
project-aon.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added new script to list all book info from bookcodes.db
[project-aon.git]
/
common
/
scripts
/
copy-ebooks.sh
diff --git
a/common/scripts/copy-ebooks.sh
b/common/scripts/copy-ebooks.sh
index
3c39738
..
651c0c5
100755
(executable)
--- a/
common/scripts/copy-ebooks.sh
+++ b/
common/scripts/copy-ebooks.sh
@@
-11,19
+11,23
@@
if [ ! -d "$AONDIR" ]; then
>&2 echo "Please set the AONDIR environment variable"
if [ ! -d "$AONDIR" ]; then
>&2 echo "Please set the AONDIR environment variable"
- exit
+ exit
1
fi
CURR_DIR=`pwd`
fi
CURR_DIR=`pwd`
+if [ "$AONDIR" -ef "$CURR_DIR" ]; then
+ >&2 echo "Current directory is the same as AONDIR: giving up"
+ exit 1
+fi
+
BASE_DIR="$AONDIR/common/epub"
BASE_DIR="$AONDIR/common/epub"
-book_db="$AONDIR/common/sqlite/bookcodes.db"
for book in $@
do
for book in $@
do
- row=(
$(sqlite3 -separator ' ' $book_db "select lang, series from bookcodes where book = '$book';")
)
+ row=(
$($AONDIR/common/scripts/list-book-info.sh $book)
)
- lang=${row[
0
]}
- series=${row[
1
]}
+ lang=${row[
1
]}
+ series=${row[
2
]}
source_dir="$BASE_DIR/$book"
source_dir="$BASE_DIR/$book"