allow wildcards in fileexists()

This commit is contained in:
hummypkg 2016-10-28 18:19:18 +00:00
parent 7745c19cfa
commit 27fb54e651
2 changed files with 6 additions and 2 deletions

View File

@ -1,7 +1,7 @@
Package: sweeper
Priority: optional
Section: misc
Version: 2.1.2
Version: 2.1.3
Architecture: mipsel
Maintainer: af123@hummypkg.org.uk
Depends: webif(>=1.3.0-1)

View File

@ -548,7 +548,11 @@ proc ::sweeper::fileexists {ts str folder} {
set str [::sweeper::expand $ts $str]
}
log " FILEEXISTS($str)" 2
return [file isfile $str]
set matches [glob -nocomplain \
-directory [file dirname $str] \
-tails [file tail $str]]
log " Matches($matches)" 2
return $([llength $matches] > 0)
}
proc ::sweeper::direxists {ts str folder} {