diff options
author | Mikhail Kobuk <[email protected]> | 2024-04-13 03:40:53 +0300 |
---|---|---|
committer | Mikhail Kobuk <[email protected]> | 2024-04-13 03:40:53 +0300 |
commit | a288b29ddc37eefeebf41ef25ec7cd60879e3c75 (patch) | |
tree | 1fe5a836c079ebedd39941efdfb1c229f729b1f1 | |
parent | 72a8049fff0a6a8500f7a018d09e4c969474b265 (diff) | |
download | linux-labs-a288b29ddc37eefeebf41ef25ec7cd60879e3c75.tar.gz linux-labs-a288b29ddc37eefeebf41ef25ec7cd60879e3c75.zip |
Fix build: skip instead of break, rework dir processing
-rwxr-xr-x | build.sh | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -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 |