LearnBoost / up

Zero-downtime reloads and requests load balancer based on distribute.
540 stars 73 forks source link

Allow up to be invoked outside of a tty #16

Closed shinuza closed 12 years ago

shinuza commented 12 years ago

If I launch this from a Makefile or a shell script:

$ nohup up server.js > foobar &

it fails with error

AssertionError: stdin must be initialized before calling setRawMode
    at Object.setRawMode (tty.js:37:10)
    at Object.<anonymous> (/Users/shinuza/Code/up/bin/up:176:5)
    at Module._compile (module.js:441:26)
    at Object..js (module.js:459:10)
    at Module.load (module.js:348:31)
    at Function._load (module.js:308:12)
    at Array.0 (module.js:479:10)
    at EventEmitter._tickCallback (node.js:192:40)

this pull request fixes this by testing if stdin is a tty prior trying to setRawMode on it.