summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNils <git@velohero.com>2016-11-06 22:50:56 +0100
committerNils <git@velohero.com>2016-11-06 22:50:56 +0100
commit1f36fa7cc405e7e2af6946fe935b193694f6dca5 (patch)
tree266cfc550693e1cd981a980ac76bb7d114e0b3ab
parent083f88808db0a7ea9f72ccd6e9c76cd19d9d6ca1 (diff)
find maxdepth 1
Note: -maxdepth is not POSIX compliant option
-rwxr-xr-xgallery.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/gallery.sh b/gallery.sh
index 2dfd560..505c653 100755
--- a/gallery.sh
+++ b/gallery.sh
@@ -202,7 +202,7 @@ done
fi
### Movies (MOV or MP4)
-if [[ $(find . -type f -name \*.mov -o -name '*.mp4' | wc -l) -gt 0 ]]; then
+if [[ $(find . -type f -name \*.mov -o -name '*.mp4' -maxdepth 1 | wc -l) -gt 0 ]]; then
cat >> "$htmlfile" << EOF
<div class="row">
<div class="col-xs-12">
@@ -212,7 +212,7 @@ if [[ $(find . -type f -name \*.mov -o -name '*.mp4' | wc -l) -gt 0 ]]; then
<div class="row">
<div class="col-xs-12">
EOF
- if [[ $(find . -type f -name \*.mov | wc -l) -gt 0 ]]; then
+ if [[ $(find . -type f -name \*.mov -maxdepth 1 | wc -l) -gt 0 ]]; then
for filename in *.[mM][oO][vV]; do
filesize=$(wc -c < "$filename" | awk '{$1/=1000000;printf "%.2fMB\n",$1}')
cat >> "$htmlfile" << EOF
@@ -220,7 +220,7 @@ EOF
EOF
done
fi
- if [[ $(find . -type f -name \*.mp4 | wc -l) -gt 0 ]]; then
+ if [[ $(find . -type f -name \*.mp4 -maxdepth 1 | wc -l) -gt 0 ]]; then
for filename in *.[mM][pP]4; do
filesize=$(wc -c < "$filename" | awk '{$1/=1000000;printf "%.2fMB\n",$1}')
cat >> "$htmlfile" << EOF
@@ -232,7 +232,7 @@ EOF
fi
### Downloads (ZIP)
-if [[ $(find . -type f -name \*.zip | wc -l) -gt 0 ]]; then
+if [[ $(find . -type f -name \*.zip -maxdepth 1 | wc -l) -gt 0 ]]; then
cat >> "$htmlfile" << EOF
<div class="row">
<div class="col-xs-12">