lib/shelly/cli/main.rb in shelly-0.0.48 vs lib/shelly/cli/main.rb in shelly-0.0.49.pre

- old
+ new

@@ -83,26 +83,32 @@ @app.code_name = options["code-name"] || ask_for_code_name @app.databases = options["databases"] || ask_for_databases @app.domains = options["domains"] || ["#{@app.code_name}.shellyapp.com"] @app.create - say "Adding remote production #{@app.git_url}", :green - @app.add_git_remote + git_remote = @app.git_remote_exist? + if !git_remote or (git_remote and yes?("Git remote #{@app} exists, overwrite (yes/no): ")) + say "Adding remote #{@app} #{@app.git_url}", :green + @app.add_git_remote + else + say "You have to manually add git remote:" + say "`git remote add NAME #{@app.git_url}`" + end say "Creating Cloudfile", :green @app.create_cloudfile if @app.attributes["trial"] say_new_line say "Billing information", :green say "Cloud created with 20 Euro credit." say "Remember to provide billing details before trial ends." - url = "#{@app.shelly.shellyapp_url}/apps/#{@app.code_name}/edit_billing" + url = "#{@app.shelly.shellyapp_url}/apps/#{@app.code_name}/billing/edit" say url end info_adding_cloudfile_to_repository - info_deploying_to_shellycloud + info_deploying_to_shellycloud(@app) rescue Client::ValidationException => e e.each_error { |error| say_error error, :with_exit => false } say_new_line say_error "Fix erros in the below command and type it again to create your cloud" , :with_exit => false @@ -342,12 +348,12 @@ end end end def ask_for_code_name - default_code_name = "#{Shelly::App.guess_code_name}-production" - code_name = ask("Cloud code name (#{default_code_name} - default):") + default_code_name = Shelly::App.guess_code_name + code_name = ask("Cloud code name (#{Shelly::App.guess_code_name} - default):") code_name.blank? ? default_code_name : code_name end def ask_for_databases kinds = Shelly::App::DATABASE_KINDS @@ -367,18 +373,18 @@ say "Project is now configured for use with Shell Cloud:", :green say "You can review changes using", :green say " git status" end - def info_deploying_to_shellycloud + def info_deploying_to_shellycloud(remote) say_new_line say "When you make sure all settings are correct please issue following commands:", :green say " git add ." say ' git commit -m "Application added to Shelly Cloud"' say " git push" say_new_line - say "Deploy to production using:", :green - say " git push production master" + say "Deploy to your cloud using:", :green + say " git push #{remote} master" say_new_line end end end end