Skip to content

Instantly share code, notes, and snippets.

@kostia
Last active January 3, 2016 20:59
Show Gist options
  • Save kostia/8518269 to your computer and use it in GitHub Desktop.
Save kostia/8518269 to your computer and use it in GitHub Desktop.
Visual dialog for "Kick it!"
#!/usr/bin/env ruby
#
# Visual dialog for "Kick it!" (https://github.com/infopark/kick-it)
#
# Requires http://mstratman.github.io/cocoadialog
# Useful for example in combination with http://fitztrev.github.io/shuttle
#
cocoa_dialog_command = '~/Applications/CocoaDialog.app/Contents/MacOS/CocoaDialog' \
' standard-inputbox --title "Kick new app"' \
' --no-newline --informative-text "Enter the project name"'
exit_status, app_name = `#{cocoa_dialog_command}`.split("\n")
# Exit status 1 - "Ok" clicked.
# Exit status 2 - "Cancel" clicked.
if exit_status.to_i == 1
exec "kick-it #{app_name}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment