From: Jonathan Blake Date: Thu, 15 Feb 2018 04:34:59 +0000 (+0000) Subject: added test to avoid attempting to overwrite files directly in $AONDIR X-Git-Tag: 20180215~5 X-Git-Url: http://git.projectaon.org/?p=project-aon.git;a=commitdiff_plain;h=b64ca08c4a11cae7af256f22c7c54aa24fc9857d;hp=c6338dc3c2d3299fdf71c128a7b707d7a69762dd added test to avoid attempting to overwrite files directly in $AONDIR git-svn-id: https://projectaon.org/data/trunk@2693 f6f3e2d7-ff33-0410-aaf5-b4bee2cdac11 --- diff --git a/common/scripts/copy-ebooks.sh b/common/scripts/copy-ebooks.sh index 3c39738..aea05d5 100755 --- a/common/scripts/copy-ebooks.sh +++ b/common/scripts/copy-ebooks.sh @@ -15,6 +15,11 @@ if [ ! -d "$AONDIR" ]; then fi CURR_DIR=`pwd` +if [ "$AONDIR" -ef "$CURR_DIR" ]; then + >&2 echo "Current directory is the same as AONDIR: giving up" + exit +fi + BASE_DIR="$AONDIR/common/epub" book_db="$AONDIR/common/sqlite/bookcodes.db" diff --git a/common/scripts/copy-svg.sh b/common/scripts/copy-svg.sh index f2b7e08..8498c4a 100755 --- a/common/scripts/copy-svg.sh +++ b/common/scripts/copy-svg.sh @@ -15,6 +15,11 @@ if [ ! -d "$AONDIR" ]; then fi CURR_DIR=`pwd` +if [ "$AONDIR" -ef "$CURR_DIR" ]; then + >&2 echo "Current directory is the same as AONDIR: giving up" + exit +fi + book_db="$AONDIR/common/sqlite/bookcodes.db" for book in $@ diff --git a/common/scripts/copy-xhtml.sh b/common/scripts/copy-xhtml.sh index cce7ada..ab24393 100755 --- a/common/scripts/copy-xhtml.sh +++ b/common/scripts/copy-xhtml.sh @@ -15,6 +15,11 @@ if [ ! -d "$AONDIR" ]; then fi CURR_DIR=`pwd` +if [ "$AONDIR" -ef "$CURR_DIR" ]; then + >&2 echo "Current directory is the same as AONDIR: giving up" + exit +fi + book_db="$AONDIR/common/sqlite/bookcodes.db" for book in $@