powder-rb / powder

Makes Pow even easier. I mean really, really, ridiculously easy
http://git.io/powder
MIT License
1.29k stars 69 forks source link

Applog and ctrl+c #104

Closed gingermusketeer closed 10 years ago

gingermusketeer commented 10 years ago

Not sure if this is the recommended approach for exiting powder applog but when i use ctrl+c i get this

^C/Users/gingermusketeer/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/powder-0.2.1/bin/powder:248:in `system': Interrupt
    from /Users/gingermusketeer/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/powder-0.2.1/bin/powder:248:in `applog'
    from /Users/gingermusketeer/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /Users/gingermusketeer/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /Users/gingermusketeer/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
    from /Users/gingermusketeer/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    from /Users/gingermusketeer/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/powder-0.2.1/bin/powder:521:in `<top (required)>'
    from /Users/gingermusketeer/.rbenv/versions/2.0.0-p451/bin/powder:23:in `load'
    from /Users/gingermusketeer/.rbenv/versions/2.0.0-p451/bin/powder:23:in `<main>'
fozcodes commented 10 years ago

Same here.

philnash commented 10 years ago

You're right, I guess we need to handle the signal better. I'd have thought there might be something built into thor for this. I'll take a look.

philnash commented 10 years ago

As you can see above, I've made 2 pull requests to get this to exit cleanly. Which do you think is best? One should be merged to make this a nicer experience.

gingermusketeer commented 10 years ago

@philnash I prefer the first one but if using trap is the correct way to handle it then that is the one to go for

fozcodes commented 10 years ago

Yeah, I second that. I'd go with Signal.trap. Thanks @philnash!

philnash commented 10 years ago

Ok, I'm going to merge #106, thanks for your input @gingermusketeer, @fosberyi.

gingermusketeer commented 10 years ago

Any chance of getting a release with this included?

philnash commented 10 years ago

Might as well put this out as a release before work goes into fixing stuff up for Yosemite. 0.2.2 coming up.

thomasklemm commented 10 years ago

Released in 0.2.2.