lib/hanzo/modules/deploy.rb in hanzo-0.1.2 vs lib/hanzo/modules/deploy.rb in hanzo-0.2

- old
+ new

@@ -3,10 +3,14 @@ protected def initialize_variables @env = extract_argument(1) + + if @env.nil? and Hanzo::Installers::Remotes.environments.keys.length == 1 + @env = Hanzo::Installers::Remotes.environments.keys.first + end end def initialize_cli initialize_help and return if @env.nil? @@ -17,18 +21,18 @@ def initialize_help @options.banner = "Usage: hanzo deploy ENVIRONMENT" end def deploy - branch = ask("-----> Branch to deploy in #{@env}: ") { |q| q.default = "HEAD" } + branch = Hanzo.ask("Branch to deploy in #{@env}:") { |q| q.default = "HEAD" } - `git push -f #{@env} #{branch}:master` + Hanzo.run "git push -f #{@env} #{branch}:master" end def run_migrations if Dir.exists?('db/migrate') - migration = agree("-----> Run migrations? ") - `bundle exec heroku run rake db:migrate --remote #{@env}` if migration + migration = Hanzo.agree('Run migrations?') + Hanzo.run "heroku run rake db:migrate --remote #{@env}" if migration end end end end