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