Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def pick_app(&block)
- require_user
- if app = app_from_dot_ninefold_file || app_from_env_id
- block.call app
- else
- load_apps do |apps|
- if apps.count > 1
- if app = interaction(:pickapp, apps)
- save_app_in_dot_ninefold_file(app)
- block.call app
- end
- elsif apps.count == 1
- say "▸ You have only one app (#{apps[0].name}) proceeding...", :yellow
- block.call apps.first
- else
- puts "You don't have any apps"
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement