My Unix config files and shell scripts, optimized for Fedora, Debian, macOS and Windows (in that order).
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
659 B

# Set my local git e-mail on a per-repo basis to my work vs. home address.
# Usage: `gu work` or `gu home` (or shortcuts: `gu w` and `gu h`)
if (scalar @ARGV == 0) {
die "Usage: gu work || gu home || gu w || gu h\n";
my $env = shift(@ARGV);
my $email = '';
if ($env =~ /^w/i) {
$email = '';
elsif ($env =~ /^h/i) {
$email = '';
else {
die "Invalid environment option, should be w[ork] or h[ome]\n";
if (!-d "./.git") {
die "You don't appear to be inside a git repository.\n";
system(qw(git config, $email);
print "E-mail updated as $email for this repository.\n";