AutoInstall
AutoInstall (startpath, [filepattern], [depth])
Function AutoInstall
is available to the _usermenu.lua script.
It looks for files whose names match filepattern
in the directory
given by startpath
and its subdirectories recursively,
and calls AddUserFile
for each matching file found.
Parameters
startpath
(string)
A path relative to the plugin’s directoryfilepattern
(string, or nil)
Lua regular expression specifying what files to install. Only file name (without path) is matched against this regular expression. If the parameter is not specified, the value"^_usermenu%.lua$"
is used.depth
(number, or nil)
The maximum depth of subdirectories to recurse into. When it is 0, the search is conducted only instartpath
. When it is not specified, the recursion depth is unlimited.
Warning
This function should be used with caution since it runs every matching file found.
Examples
AutoInstall ("scripts")
AutoInstall ("scripts", nil, 1)
AutoInstall ("scripts/cool", "^_.*menu%.lua$", 0)