-
-
Save steveklabnik/4045598 to your computer and use it in GitHub Desktop.
A ruby script to change pairs
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 usage | |
puts "./pair [name]: pair two people" | |
puts "./pair : switch to just steve" | |
exit | |
end | |
def set_config(name, email) | |
`git config user.name "#{name}"` | |
`git config user.email #{email}` | |
end | |
usage && exit if ARGV.first == "help" | |
pairs = { | |
"sk-ko" => { | |
:left => "Steve Klabnik", | |
:right => "Katrina Owen", | |
:email => "[email protected]", | |
}, | |
} | |
name = "" | |
email = "" | |
if ARGV.size == 0 | |
name = "Steve Klabnik" | |
email = "[email protected]" | |
puts "Moving to just Steve." | |
else | |
pair = pairs[ARGV.first] | |
name = "#{pair[:left]} + #{pair[:right]}" | |
email = pair[:email] | |
puts "Pairing #{name}" | |
end | |
set_config(name, email) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment