lib/shelly/app.rb in shelly-0.0.9 vs lib/shelly/app.rb in shelly-0.0.10

- old
+ new

@@ -8,14 +8,19 @@ def initialize @ruby_version = "MRI-1.9.2" end - def add_git_remote + def add_git_remote(force = false) + system("git remote rm #{purpose}") if force system("git remote add #{purpose} #{git_url}") end + def remote_exists? + IO.popen("git remote").read.split("\n").include?(purpose) + end + def git_url "git@git.shellycloud.com:#{code_name}.git" end def generate_cloudfile @@ -55,8 +60,12 @@ end def open_billing_page url = "#{shelly.api_url}/apps/#{code_name}/edit_billing?api_key=#{current_user.token}" Launchy.open(url) + end + + def self.inside_git_repository? + system("git status &> /dev/null") end end end