From 3dab455d27a74f847ba3743a7531e64fd5456f89 Mon Sep 17 00:00:00 2001 From: Lukas Macura Date: Mon, 4 Apr 2016 14:48:57 +0200 Subject: [PATCH] Repaired fs discovery --- fsx/control.zaf | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/fsx/control.zaf b/fsx/control.zaf index 385dd14..156f53d 100644 --- a/fsx/control.zaf +++ b/fsx/control.zaf @@ -17,9 +17,9 @@ Depends-bin: curl find Item discovery: Description:: - Discovery of files or directories + Discovery of files or directories. Enter % instead of * in mask. :: -Parameters: directory mask type depth +Parameters: directory mask depth type Type: string Script:: #!/bin/sh @@ -28,20 +28,12 @@ Script:: [ -z "$1" ] && zaf_err "Directory must be entered." dir="$1" - -if [ -n "$2" ]; then - mask="-name '$2'" -fi - -if [ -n "$3" ]; then - type="-type $3" -fi - +mask="-name '$(echo $2|tr '%' '*')'" +depth="-maxdepth $3" if [ -n "$4" ]; then - depth="-maxdepth $4" + type="-type $4" fi -zaf_dbg find "$dir" $type $depth $mask eval find "$dir" $depth $type $mask | zaf_discovery '{#PATH}' ::