mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-31 12:16:21 +00:00
Merge remote-tracking branch 'philipflohr/master'
This commit is contained in:
@@ -6819,12 +6819,6 @@ cmd_plugins_install(ProfWin *window, const char *const command, gchar **args)
|
|||||||
path = strdup(path);
|
path = strdup(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (access(path, R_OK) != 0) {
|
|
||||||
cons_show("File not found: %s", path);
|
|
||||||
free(path);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (is_regular_file(path)) {
|
if (is_regular_file(path)) {
|
||||||
if (!g_str_has_suffix(path, ".py") && !g_str_has_suffix(path, ".so")) {
|
if (!g_str_has_suffix(path, ".py") && !g_str_has_suffix(path, ".so")) {
|
||||||
cons_show("Plugins must have one of the following extensions: '.py' '.so'");
|
cons_show("Plugins must have one of the following extensions: '.py' '.so'");
|
||||||
@@ -6844,9 +6838,7 @@ cmd_plugins_install(ProfWin *window, const char *const command, gchar **args)
|
|||||||
g_string_free(error_message, TRUE);
|
g_string_free(error_message, TRUE);
|
||||||
free(path);
|
free(path);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
} else if (is_dir(path)) {
|
||||||
|
|
||||||
if (is_dir(path)) {
|
|
||||||
PluginsInstallResult* result = plugins_install_all(path);
|
PluginsInstallResult* result = plugins_install_all(path);
|
||||||
if (result->installed || result->failed) {
|
if (result->installed || result->failed) {
|
||||||
if (result->installed) {
|
if (result->installed) {
|
||||||
@@ -6873,10 +6865,11 @@ cmd_plugins_install(ProfWin *window, const char *const command, gchar **args)
|
|||||||
free(path);
|
free(path);
|
||||||
plugins_free_install_result(result);
|
plugins_free_install_result(result);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
} else {
|
||||||
|
cons_show("Argument must be a file or directory.");
|
||||||
}
|
}
|
||||||
|
|
||||||
free(path);
|
free(path);
|
||||||
cons_show("Argument must be a file or directory.");
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user