Jelajahi Sumber

Fix issue where error message is printed twice in testrail-report

George S. Baugh 11 tahun lalu
induk
melakukan
f8a6b7d853
1 mengubah file dengan 8 tambahan dan 2 penghapusan
  1. 8 2
      bin/testrail-report

+ 8 - 2
bin/testrail-report

@@ -203,8 +203,14 @@ if ($file) {
     close($fh);
 } else {
     #Just read STDIN, print help if no file was passed
-    if (IO::Interactive::Tiny::is_interactive()) { print "ERROR: no file passed, and no data piped in! See --help for usage." }
-    if ( !$run || !$apiurl || !$password || !$user || !$project ) { print "ERROR: Interactive mode not allowed when piping input.  See --help for options.\n"; exit 0;};
+    if (IO::Interactive::Tiny::is_interactive()) {
+        print "ERROR: no file passed, and no data piped in! See --help for usage.";
+        exit(1);
+    }
+    if ( !$run || !$apiurl || !$password || !$user || !$project ) {
+        print "ERROR: Interactive mode not allowed when piping input.  See --help for options.\n";
+        exit(1);
+    }
     while (<>) {
         $_ = colorstrip($_); #strip prove brain damage
         s/^\s*//g; #Fix prove brain damage