Posted to tcl by Siqsuruq at Thu Dec 22 22:06:27 GMT 2022view pretty
:public method load_dz_procs {args} {
set folders [glob -nocomplain -directory [file join ${:path} [: get_global mod_dir]] *]
foreach f $folders {
set module_namepace [file tail $f]
set files [glob -nocomplain -directory $f *.tcl]
foreach file $files {
if {[regexp {Class.tcl} $file] == 1} {
source $file
} else {
# It will give error that $file not found
namespace eval $module_namepace { source $file }
}
}
}
}