   sync = (func, ctx) ->
     fn.lift(func.bind(@))
 
+  execute = (cmd) ->
+    cmd = exec(cmd)
+    if (cmd.code > 0) then throw cmd.output
+
 module.exports = Heroku

      name: null

    @errors =
      not_installed: "You need to install heroku first. We'll open the download page for you"
      not_authenticated: "You are not logged in to heroku -- try running `heroku login`"

  deploy: (cb) ->
    console.log "deploying #{@path} to Heroku"

    if exec('git branch -r | grep heroku').output != '' then return

    console.log 'creating app on heroku...'.grey
    execute "heroku create #{@config.name || ''}"

  push_code = ->
    console.log 'pushing master branch to heroku (this may take a few seconds)...'.grey
    execute 'git push heroku master'

  # 
  # @api private
