Skip to content

Commit

Permalink
take out co
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Dickey committed May 20, 2016
1 parent 98c0adb commit 474c827
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/command.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict'

let co = require('co')
let Heroku = require('heroku-client')
let cli = require('..')

Expand Down Expand Up @@ -115,15 +114,12 @@ function reasonPrompt (context) {

module.exports = function command (options, fn) {
return function (context) {
if (typeof options === 'function') {
fn = options
options = {}
}
if (typeof options === 'function') [fn, options] = [options, {}]
if (httpsProxy) setupHttpProxy()
cli.color.enabled = context.supportsColor
let handleErr = cli.errorHandler(errHandlerOpts(options.rollbar, context))
let run = function () {
return co.wrap(fn)(context, heroku(context))
return fn(context, heroku(context))
.catch(function (err) {
if (err && err.body && err.body.id === 'unauthorized') {
cli.error(err.body.message || 'Unauthorized')
Expand Down

0 comments on commit 474c827

Please sign in to comment.