lib/cookbook-release/git-utilities.rb in cookbook-release-0.1 vs lib/cookbook-release/git-utilities.rb in cookbook-release-0.3
- old
+ new
@@ -3,10 +3,12 @@
require 'mixlib/shellout'
require 'highline/import'
class GitUtilities
+ attr_accessor :no_prompt
+
def initialize(options={})
@tag_prefix = options['tag_prefix'] || ''
end
def reset_command(new_version)
@@ -60,10 +62,11 @@
def choose_remote
cmd = Mixlib::ShellOut.new("git remote")
cmd.run_command
cmd.error!
remotes = cmd.stdout.split("\n")
- if remotes.size == 1
+ if remotes.size == 1 || @no_prompt
+ puts "Choosing remote #{remotes.first}" if @no_prompt
remotes.first
else
choose(*remotes)
end
end