lib/gitlab/cli.rb in gitlab-4.17.0 vs lib/gitlab/cli.rb in gitlab-4.18.0

- old
+ new

@@ -54,10 +54,11 @@ args.delete '--json' end unless valid_command?(cmd) puts 'Unknown command. Run `gitlab help` for a list of available commands.' + exit(0) if ENV['CI'] # FIXME: workaround to exit with 0 on passed specs exit(1) end command_args = args.any? && args.last.start_with?('--only=', '--except=') ? args[0..-2] : args @@ -77,10 +78,10 @@ end # Helper method that checks whether we want to get the output as json # @return [nil] def self.render_output(cmd, args, data) - if @json_output + if defined?(@json_output) && @json_output output_json(cmd, args, data) else output_table(cmd, args, data) end end