Fix handling depth
This commit is contained in:
parent
e5fa14b68a
commit
cbd7ef41cf
|
@ -15,13 +15,13 @@ function queueexec {
|
||||||
}
|
}
|
||||||
function iteratedirs {
|
function iteratedirs {
|
||||||
local dir="$1"
|
local dir="$1"
|
||||||
local depth="$2"
|
local currentlevel="$2"
|
||||||
local current_rel_dir="$3"
|
local current_rel_dir="$3"
|
||||||
|
|
||||||
for item in "$dir"/*; do
|
for item in "$dir"/*; do
|
||||||
if [[ -d $item ]]; then
|
if [[ -d $item ]]; then
|
||||||
if [[ $depth == none ]] || [[ $currentlevel -lt $depth ]]; then
|
if [[ $depth == none ]] || [[ $currentlevel -lt $depth ]]; then
|
||||||
iteratedirs "${item}" $(($depth + 1)) "${current_rel_dir}${item##*/}/"
|
iteratedirs "${item}" $(($currentlevel + 1)) "${current_rel_dir}${item##*/}/"
|
||||||
fi
|
fi
|
||||||
elif [[ -f $item ]]; then
|
elif [[ -f $item ]]; then
|
||||||
if [[ ! $filter ]] || [[ $item =~ $filter ]]; then
|
if [[ ! $filter ]] || [[ $item =~ $filter ]]; then
|
||||||
|
|
Loading…
Reference in New Issue