From d4888152e5fa55949c2d0597566b77c6e3b1c7ba Mon Sep 17 00:00:00 2001 From: ville rantanen Date: Tue, 16 Sep 2014 09:30:42 +0300 Subject: [PATCH] exclude hidden files --- anduril/Folder2Array | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/anduril/Folder2Array b/anduril/Folder2Array index 8d92348..89bb8a1 100755 --- a/anduril/Folder2Array +++ b/anduril/Folder2Array @@ -1,16 +1,21 @@ #!/bin/bash MAXDEPTH="-maxdepth 1" +HIDDEN="-not -path */\.*" ME=$( basename "$0" ) HELP='Create an array _index for Anduril of the given folder. -Usage: '$ME' [-r] [path] +Usage: '$ME' [-ar] [path] + -a Include ".*" hidden files -r Recursively find all files in path, excluding folders ' -while getopts ":rh" opt; do +while getopts ":arh" opt; do case $opt in + a) + HIDDEN="" + ;; r) MAXDEPTH="-type f" ;; @@ -30,4 +35,4 @@ INPATH="$1" [ -z "$INPATH" ] && INPATH=. echo -e '"Key"'"\t"'"File"' -find "$INPATH" -mindepth 1 $MAXDEPTH -not -name _index -printf '"%P"\t"%P"\n' | sort -V +find "$INPATH" -mindepth 1 $MAXDEPTH $HIDDEN -not -name _index -printf '"%P"\t"%P"\n' | sort -V