lib/cc/cli/runner.rb in codeclimate-0.52.0 vs lib/cc/cli/runner.rb in codeclimate-0.53.0
- old
+ new
@@ -1,7 +1,8 @@
require "active_support"
require "active_support/core_ext"
+require "cc/cli/version_checker"
module CC
module CLI
class Runner
def self.run(argv)
@@ -15,10 +16,12 @@
def initialize(args)
@args = args
end
def run
+ VersionChecker.new.check if check_version?
+
if command_class
command = command_class.new(command_arguments)
command.execute
else
command_not_found
@@ -52,9 +55,20 @@
"help"
when "-v", "--version"
"version"
else
command_name
+ end
+ end
+
+ private
+
+ def check_version?
+ if ARGV.first == "--no-check-version"
+ ARGV.shift
+ false
+ else
+ true
end
end
end
end
end