Use <configdir>/scripts to (auto)load Lua/Perl/Python/Tcl scripts
This commit is contained in:
@ -89,8 +89,10 @@ static char unknown[] = {
|
||||
"}\n"
|
||||
};
|
||||
|
||||
/* don't pollute the filesystem with script files, this only causes misuse of the folders
|
||||
* only use ~/.config/hexchat/scripts/ and %APPDATA%\HexChat\scripts */
|
||||
static char sourcedirs[] = {
|
||||
"set files [lsort [glob -nocomplain -directory [xchatdir] \"*.tcl\"]]\n"
|
||||
"set files [lsort [glob -nocomplain -directory [xchatdir] \"/scripts/*.tcl\"]]\n"
|
||||
"set init [lsearch -glob $files \"*/init.tcl\"]\n"
|
||||
"if { $init > 0 } {\n"
|
||||
"set initfile [lindex $files $init]\n"
|
||||
@ -2037,7 +2039,7 @@ static int Command_Source(char *word[], char *word_eol[], void *userdata)
|
||||
} else {
|
||||
if (!strchr(word_eol[2], '/')) {
|
||||
Tcl_DStringAppend(&ds, xchatdir, strlen(xchatdir));
|
||||
Tcl_DStringAppend(&ds, "/", 1);
|
||||
Tcl_DStringAppend(&ds, "/scripts/", 9);
|
||||
Tcl_DStringAppend(&ds, word_eol[2], strlen(word_eol[2]));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user