From: Hugo Villeneuve Date: Tue, 10 Oct 2023 13:47:33 +0000 (-0400) Subject: Better support spaces in src filename X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=82d3c92276a2a97dc50911dcf829a1c71d035079;p=fgen.git Better support spaces in src filename But still doesn't work because of the files arguments passed to the convert command. --- diff --git a/fgen.sh b/fgen.sh index 8a700c7..c7065c8 100755 --- a/fgen.sh +++ b/fgen.sh @@ -230,20 +230,14 @@ if [ $# -eq 0 ]; then exit 1 fi -if [ $# -gt 1 ]; then - echo "${PROG_NAME}: Trop d'arguments." - echo "Essayez \`${PROG_NAME} -h' pour plus d'informations." - exit 1 -fi +src="${*}" -if [ ! -f "${1}" ]; then +if [ ! -f "${src}" ]; then log_err "Error: PSD source file not found" exit 1 fi -src=${1} - -dest=$(basename -s .psd ${1}) +dest=$(basename -s .psd "${src}") layers=${dest}/layers.txt if [ ! -d ${dest} ]; then @@ -259,7 +253,7 @@ done if [ ${trames} -eq 1 ]; then # %s: scene number - identify ${IM_OPS} -verbose -format "scene:%s,label:%l,geometry:%g,\n" ${src} > ${layers} + identify ${IM_OPS} -verbose -format "scene:%s,label:%l,geometry:%g,\n" "${src}" > ${layers} # Remove line(s) with empty label: ${SED} -i -e /label:,.*/d ${layers}