Browse Source

give an error when trying to enable a nonexistent plugin
through the conf.pl commandline, thanks Tomas Kuliavas.

Thijs Kinkhorst 17 years ago
parent
commit
a5dcf2339c
1 changed files with 8 additions and 3 deletions
  1. 8 3
      config/conf.pl

+ 8 - 3
config/conf.pl

@@ -482,9 +482,14 @@ $ask_user_info = 'true'                if ( !$ask_user_info );
 
 
 if ( $ARGV[0] eq '--install-plugin' ) {
 if ( $ARGV[0] eq '--install-plugin' ) {
     print "Activating plugin " . $ARGV[1] . "\n";
     print "Activating plugin " . $ARGV[1] . "\n";
-    push @plugins, $ARGV[1];
-    save_data();
-    exit(0);
+    if ( -d "../plugins/" . $ARGV[1]) {
+        push @plugins, $ARGV[1];
+        save_data();
+        exit(0);
+    } else {
+        print "No such plugin.\n";
+        exit(1);
+    }
 } elsif ( $ARGV[0] eq '--remove-plugin' ) {
 } elsif ( $ARGV[0] eq '--remove-plugin' ) {
     print "Removing plugin " . $ARGV[1] . "\n";
     print "Removing plugin " . $ARGV[1] . "\n";
     foreach $plugin (@plugins) {
     foreach $plugin (@plugins) {