From: Mikhail Kobuk Date: Sat, 13 Apr 2024 00:40:53 +0000 (+0300) Subject: Fix build: skip instead of break, rework dir processing X-Git-Url: http://arktixord.com/git/?a=commitdiff_plain;h=a288b29ddc37eefeebf41ef25ec7cd60879e3c75;p=linux-labs.git Fix build: skip instead of break, rework dir processing --- diff --git a/build.sh b/build.sh index cf09148..0067dac 100755 --- a/build.sh +++ b/build.sh @@ -11,6 +11,17 @@ sources=${@:4} echo "using command <${pancompile}>" echo "for sources: ${sources}" +function process_dir() { + pushd . + arg_dir=$1 + + cd ${arg_dir} + indir_src="$(find . -name '*.md')" + indir_out="${indir_src##*/}" + ${panexec} ${panflags} ${indir_src} ${panformat} -o ../${indir_out%.*}.html + popd +} + for src in ${sources}; do if [ -d ${src} ]; then printf "\tfound dir: ${src}\n" @@ -20,9 +31,7 @@ for src in ${sources}; do continue fi - indir_src="$(find ${src} -name '*.md')" - indir_out="${indir_src##*/}" - ${panexec} ${panflags} ${indir_src} ${panformat} -o ${indir_out%.*}.html + process_dir ${src} elif [ -f ${src} ] && [ "${src##*.}" == "md" ]; then printf "\tfound md file: ${src}\n" @@ -30,8 +39,7 @@ for src in ${sources}; do printf "\t${panexec} ${panflags} ${src} ${panformat} -o ${src%.*}.html" ${panexec} ${panflags} ${src} ${panformat} -o ${src%.*}.html else - echo "unknown source" - exit 1 + printf "Unknown source (%s) - skipping\n" "$src" fi done