diff --git a/gen.sh b/gen.sh index 8508322..f9c7265 100755 --- a/gen.sh +++ b/gen.sh @@ -56,16 +56,45 @@ newdataentry () { dependencies="cat grep head cut date printf" assert_tools ${dependencies} err=0 + customdir=$(pwd) fl="" test $# -eq 0 && { >&2 echo "determining entry based on data.xml.\n" lastentry=$(cat data.xml |grep -i "&2 echo "custom base directory for files such as jpg, pdf, epub: "${customdir}".\n" + } test "$1" = "help" && { echo "prints a new data entry for a release of datenschleuder\n" echo "release [options]\n" echo "option\tdescription\n" + echo "directory\tcustom data directory for availability test and filesize, default pwd" echo "number\tprint entry for release with custom number, default is the increment of the top entry in data.xml\n" echo "date\tuse a unix timestamp for a custom date\n" echo "teaser\tinclude teaser xml-message as last argument(s)\n" @@ -98,15 +127,15 @@ newdataentry () { #~ *) echo "file "${ffn}" not found, in "${d}"." ;; esac #~ echo $ffn - test -e ${ffn} && { + test -e ${customdir}"/"${ffn} && { test "$d" = "covers" && { echo "\t"${cover}"" } || { - fs=$(stat -c %s ${ffn}) + fs=$(stat -c %s ${customdir}"/"${ffn}) echo "\t"${ffn}"" } } || { - mfl=${ffn}"\n" + mfl=${mfl}" "${ffn}"\n" #~ echo "file "${ffn}" not found." err=3 } @@ -118,7 +147,7 @@ newdataentry () { } echo "" test "$teaser" = "" && { >&2 echo "\nmissing teaser message."; } - test -e $cover || { >&2 echo "\nmissing cover."; } + test -e ${customdir}"/"$cover || { >&2 echo "\nmissing cover file: "${cover}; } test $err -gt 0 && { >&2 echo "\nmissing files:\n"${mfl}; } } newinfoentry () {