mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 07:00:11 +01:00
18 lines
523 B
Text
18 lines
523 B
Text
proc find {{basedir .} {filterScript {}}} {
|
|
set oldwd [pwd]
|
|
cd $basedir
|
|
set cwd [pwd]
|
|
set filenames [glob -nocomplain * .*]
|
|
set files {}
|
|
set filt [string length $filterScript]
|
|
foreach filename $filenames {
|
|
if {!$filt || [eval $filterScript [list $filename]]} {
|
|
lappend files [file join $cwd $filename]
|
|
}
|
|
if {[file isdirectory $filename]} {
|
|
set files [concat $files [find $filename $filterScript]]
|
|
}
|
|
}
|
|
cd $oldwd
|
|
return $files
|
|
}
|