X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=tools.sh;h=4e93d3f4229049ef70ed84adf81eb20d81da3ffa;hb=19dff502e8d78c56a1a8a09e9b9d27f304839a6e;hp=d147b73e6355b0d2ead11eb5097f4adc80724acc;hpb=077edce7af099f763d4e4cc2de6387005373c98c;p=shellwiki diff --git a/tools.sh b/tools.sh index d147b73..4e93d3f 100755 --- a/tools.sh +++ b/tools.sh @@ -106,22 +106,17 @@ page_glob(){ esac \ | sort -u \ | while read -r page; do - case $page in - \#*|*/\#*) # Not a page directory (just a metadata dir) - continue - ;; - \[*\]/*|*/\[*\]/*) # Omit "system" pages unless explicitly wanted - [ "$glob_system_pages" != true ] \ - && continue \ - || pagedir="$(page_abs "$page")" - ;; - \:*|*/\:*) # Omit translation pages if translations are enabled - [ "$LANGUAGE_DEFAULT" ] \ - && continue \ - || pagedir="$(page_abs "$page")" - ;; - *) pagedir="$(page_abs "$page")";; - esac + # Not a page directory (just a metadata dir) + [ ! "${page%%#*}" -o ! "${page%%*/#*}" ] && continue + + # Omit "system" pages unless explicitly wanted + [ ! "${page%%\[*\]/*}" -o ! "${page%%*/\[*\]/*}" ] && [ "$glob_system_pages" != true ] && continue + + # Omit translation pages if translations are enabled + [ ! "${page%%:*}" -o ! "${page%%*/:*}" ] && [ "$LANGUAGE_DEFAULT" ] && continue + + pagedir="$(page_abs "$page")" + if [ -d "$_DATA/pages/$pagedir" -o -d "$_EXEC/pages/$pagedir" ]; then printf '%s\n' "$page" if ! [ "$depth" -eq 0 ]; then