diff options
author | Nils <git@velohero.com> | 2016-11-06 22:50:56 +0100 |
---|---|---|
committer | Nils <git@velohero.com> | 2016-11-06 22:50:56 +0100 |
commit | 1f36fa7cc405e7e2af6946fe935b193694f6dca5 (patch) | |
tree | 266cfc550693e1cd981a980ac76bb7d114e0b3ab /gallery.sh | |
parent | 083f88808db0a7ea9f72ccd6e9c76cd19d9d6ca1 (diff) |
find maxdepth 1
Note: -maxdepth is not POSIX compliant option
Diffstat (limited to 'gallery.sh')
-rwxr-xr-x | gallery.sh | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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"> |