Skip to content

Commit

Permalink
Trap interrupt during option input
Browse files Browse the repository at this point in the history
Fixes #81
  • Loading branch information
gfontenot committed Mar 11, 2014
1 parent 25158cd commit a2bcf24
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions lib/liftoff/launchpad.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,14 @@ def liftoff
private

def fetch_options
@config.project_name = ask('Project name? ') { |q| q.default = @config.project_name }
@config.company = ask('Company name? ') { |q| q.default = @config.company }
@config.author = ask('Author name? ') { |q| q.default = @config.author }
@config.prefix = ask('Prefix? ') { |q| q.default = @config.prefix }.upcase
begin
@config.project_name = ask('Project name? ') { |q| q.default = @config.project_name }
@config.company = ask('Company name? ') { |q| q.default = @config.company }
@config.author = ask('Author name? ') { |q| q.default = @config.author }
@config.prefix = ask('Prefix? ') { |q| q.default = @config.prefix }.upcase
rescue Interrupt, EOFError
exit 1
end
end

def perform_project_actions
Expand Down Expand Up @@ -69,7 +73,7 @@ def enable_warnings
def enable_static_analyzer
xcode_helper.enable_static_analyzer(@config.enable_static_analyzer)
end

def open_project
`open -a "Xcode" .`
end
Expand Down

0 comments on commit a2bcf24

Please sign in to comment.