sintaxi/surge — pull request #17 by kennethormandy (2014-11-17 21:59:50+00:00)
Title: Adds a friendly goodbye instead of erroring

There’s probably a better spot to put this, but I thought Surge should exit quietly if you changed your mind about a deployment instead of giving an error:

```sh
TypeError: Cannot read property 'project' of undefined
at /Users/kennethormandy/Sites/kennethormandy/surge/lib/middleware/project.js:24:15
at /Users/kennethormandy/Sites/kennethormandy/surge/node_modules/prompt/lib/prompt.js:316:20
at /Users/kennethormandy/Sites/kennethormandy/surge/node_modules/prompt/node_modules/utile/node_modules/async/lib/async.js:136:21
at assembler (/Users/kennethormandy/Sites/kennethormandy/surge/node_modules/prompt/lib/prompt.js:282:18)
at /Users/kennethormandy/Sites/kennethormandy/surge/node_modules/prompt/lib/prompt.js:322:20
at /Users/kennethormandy/Sites/kennethormandy/surge/node_modules/prompt/lib/prompt.js:510:14
at onError (/Users/kennethormandy/Sites/kennethormandy/surge/node_modules/prompt/node_modules/read/lib/read.js:94:12)
at Interface. (/Users/kennethormandy/Sites/kennethormandy/surge/node_modules/prompt/node_modules/read/lib/read.js:66:5)
at Interface.EventEmitter.emit (events.js:92:17)
at Interface._ttyWrite
```

Then, I realised we could say a friendly goodbye instead. This is just an example for now, but later we could do some cool stuff with it, ex. random messages, last Tweet…I dunno.

To try it out:

```sh
./lib/cli.js
# Now press ctrl+c
```