about summary refs log tree commit diff stats
path: root/src/command
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2019-10-05 15:04:46 +0200
committerMichael Vetter <jubalh@iodoru.org>2019-10-05 15:04:46 +0200
commit4637a7a23bdba9085a2772152b73342d7a6ff679 (patch)
treedea35a1a85ea1ebbacd1b1f9539b054a2ce07868 /src/command
parentc135f989ec779f1f2d6438c2220156baaf616065 (diff)
parent73549dc7517534b4d03ffbdb0e0fa10617bf7675 (diff)
downloadprofani-tty-4637a7a23bdba9085a2772152b73342d7a6ff679.tar.gz
Merge remote-tracking branch 'philipflohr/master'
Diffstat (limited to 'src/command')
-rw-r--r--src/command/cmd_funcs.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c
index 30e7720f..afec87fe 100644
--- a/src/command/cmd_funcs.c
+++ b/src/command/cmd_funcs.c
@@ -6819,12 +6819,6 @@ cmd_plugins_install(ProfWin *window, const char *const command, gchar **args)
         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 (!g_str_has_suffix(path, ".py") && !g_str_has_suffix(path, ".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);
         free(path);
         return TRUE;
-    }
-
-    if (is_dir(path)) {
+    } else if (is_dir(path)) {
         PluginsInstallResult* result = plugins_install_all(path);
         if (result->installed || result->failed) {
             if (result->installed) {
@@ -6873,10 +6865,11 @@ cmd_plugins_install(ProfWin *window, const char *const command, gchar **args)
         free(path);
         plugins_free_install_result(result);
         return TRUE;
+    } else {
+        cons_show("Argument must be a file or directory.");
     }
 
     free(path);
-    cons_show("Argument must be a file or directory.");
     return TRUE;
 }