Skip to content

Instantly share code, notes, and snippets.

@tdouce
Last active August 29, 2015 14:24
Show Gist options
  • Save tdouce/d0499c882ad63a6e1774 to your computer and use it in GitHub Desktop.
Save tdouce/d0499c882ad63a6e1774 to your computer and use it in GitHub Desktop.
Branch name generator
#!/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