lib/travis/cli/command.rb in travis-1.6.1.travis.363.4 vs lib/travis/cli/command.rb in travis-1.6.1

- old
+ new

@@ -132,16 +132,23 @@ error "Outdated CLI version, run `gem install travis` or use --skip-version-check." if Travis::VERSION < last_check['version'] rescue Timeout::Error, Faraday::Error::ClientError end def check_completion - return if skip_completion_check? or config['checked_completion'] or !interactive? - write_to($stderr) do - next if Tools::Completion.completion_installed? - next unless agree('Shell completion not installed. Would you like to like to install it now? ') { |q| q.default = "y" } - Tools::Completion.install_completion + return if skip_completion_check? or !interactive? + + if config['checked_completion'] + Tools::Completion.update_completion if config['completion_version'] != Travis::VERSION + else + write_to($stderr) do + next Tools::Completion.update_completion if Tools::Completion.completion_installed? + next unless agree('Shell completion not installed. Would you like to like to install it now? ') { |q| q.default = "y" } + Tools::Completion.install_completion + end end + config['checked_completion'] = true + config['completion_version'] = Travis::VERSION end def check_ruby return if RUBY_VERSION > '1.9.2' or skip_version_check? warn "Your Ruby version is outdated, please consider upgrading, as we will drop support for #{RUBY_VERSION} soon!"