Last active
December 14, 2017 18:58
-
-
Save calebhaye/68ee7ab9253abacb6c028be23db462e5 to your computer and use it in GitHub Desktop.
Ruby bash script to create a git branch from string STDIN
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 -w | |
name = ARGV[0] | |
slug = name.downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, '') | |
system("git checkout -b #{slug}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment