Browse code

deb: skip hidden files when generating indexes

We don't need hidden files to be listed
in the indexes, so skip them if hidden
files exist.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Sebastiaan van Stijn authored on 2016/06/10 04:07:17
Showing 1 changed files
... ...
@@ -40,8 +40,8 @@ create_index() {
40 40
 	# change IFS locally within subshell so the for loop saves line correctly to L var
41 41
 	IFS=$'\n';
42 42
 
43
-	# pretty sweet, will mimick the normal apache output
44
-	for L in $(find -L . -mount -depth -maxdepth 1 -type f ! -name 'index' -printf "<a href=\"%f\">%f|@_@%Td-%Tb-%TY %Tk:%TM  @%f@\n"|sort|column -t -s '|' | sed 's,\([\ ]\+\)@_@,</a>\1,g');
43
+	# pretty sweet, will mimick the normal apache output. skipping "index" and hidden files
44
+	for L in $(find -L . -mount -depth -maxdepth 1 -type f ! -name 'index' ! -name '.*' -prune -printf "<a href=\"%f\">%f|@_@%Td-%Tb-%TY %Tk:%TM  @%f@\n"|sort|column -t -s '|' | sed 's,\([\ ]\+\)@_@,</a>\1,g');
45 45
 	do
46 46
 		# file
47 47
 		F=$(sed -e 's,^.*@\([^@]\+\)@.*$,\1,g'<<<"$L");