Last active
August 29, 2015 14:24
-
-
Save tdouce/d0499c882ad63a6e1774 to your computer and use it in GitHub Desktop.
Branch name generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
def remove_unruly_chars(string) | |
string.downcase.gsub(/[\s\W]/, '_') | |
end | |
branch_name = ARGV[0] | |
story = ARGV[1] | |
branch = "travisdouce/#{ story + '-' if story }#{ remove_unruly_chars(branch_name) } " | |
`echo "#{ branch }" | pbcopy` | |
puts branch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment