X-Git-Url: http://git.projectaon.org/?p=project-aon.git;a=blobdiff_plain;f=common%2Fscripts%2Fcopy-svg.sh;h=532af7cac6f4a23c6ed292ef1646976253e86c10;hp=f2b7e087ce74ed82620342753eb5f0f93a87f3a5;hb=b69a7bbcab9942e91cf644e10491f42d62ff2752;hpb=c6338dc3c2d3299fdf71c128a7b707d7a69762dd diff --git a/common/scripts/copy-svg.sh b/common/scripts/copy-svg.sh index f2b7e08..532af7c 100755 --- a/common/scripts/copy-svg.sh +++ b/common/scripts/copy-svg.sh @@ -11,18 +11,21 @@ if [ ! -d "$AONDIR" ]; then >&2 echo "Please set the AONDIR environment variable" - exit + exit 1 fi CURR_DIR=`pwd` -book_db="$AONDIR/common/sqlite/bookcodes.db" +if [ "$AONDIR" -ef "$CURR_DIR" ]; then + >&2 echo "Current directory is the same as AONDIR: giving up" + exit 1 +fi 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="$AONDIR/$lang/svg/$series" output_dir="$CURR_DIR/$lang/svg/$series"