nodejitsu/jitsu — pull request #308 by wibuni (2012-09-03 13:01:00+00:00)
Title: Fixed some more unhandled errors when aborting

I found some more erros when calling functions as unauthorization users and liked to discuss them with you, before applying a proper fix.
When ctr+c inside username prompt, jitsu crashes with unhandeld error.

> $user@$host ~ $ jitsu logs
> info: Welcome to Nodejitsu
> info: jitsu v0.9.8
> info: It worked if it ends with Nodejitsu ok
> prompt: username:
> /home/$user/lib/node_modules/jitsu/lib/jitsu.js:167
> return jitsu.showError.apply(jitsu, [command[0]].concat(arguments)
> ^
> ReferenceError: command is not defined
> at jitsu.start (/home/$user/lib/node_modules/jitsu/lib/jitsu.js:167:50)
> at /home/$user/lib/node_modules/jitsu/node_modules/flatiron-cli-users/lib/commands.js:206:16
> at prompt.get (/home/$user/lib/node_modules/jitsu/node_modules/flatiron/node_modules/prompt/lib/prompt.js:317:20)
> at async.forEachSeries.iterate (/home/$user/lib/node_modules/jitsu/node_modules/flatiron/node_modules/prompt/node_modules/utile/node_modules/async/lib/async.js:110:21)
> at assembler (/home/$user/lib/node_modules/jitsu/node_modules/flatiron/node_modules/prompt/lib/prompt.js:283:18)
> at prompt.get (/home/$user/lib/node_modules/jitsu/node_modules/flatiron/node_modules/prompt/lib/prompt.js:323:20)
> at prompt.getInput (/home/$user/lib/node_modules/jitsu/node_modules/flatiron/node_modules/prompt/lib/prompt.js:473:14)
> at onError (/home/$user/lib/node_modules/jitsu/node_modules/flatiron/node_modules/prompt/node_modules/read/lib/read.js:93:12)
> at Interface. (/home/$user/lib/node_modules/jitsu/node_modules/flatiron/node_modules/prompt/node_modules/read/lib/read.js:65:5)
> at Interface.EventEmitter.emit (events.js:115:20)

This seems like you reference a variable, that isn't initalized yet. I changed it so it will refer to the actual argv given.

The second commit is the fix for an unhandled error situation when aborting at `jitsu deploy` dialogue asking for "Is this okay? (yes)"