Duke's utils
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.
 
 
 
 

50 lines
879 B

#!/usr/bin/env perl
use strict;
use warnings;
my @config_files = qw/
.bashrc
.bashrc.aliases
.dir_colors
.gitconfig
.irssi
.perldb
.proverc
.psqlrc
.screenrc
.vimperatorrc
.vimrc
.Xmodmap
/;
my @config_dirs = qw/
.bash
.ssh
.vim
/;
my $dir = shift || '/home/leto/git/util';
die "$dir does not exist!" unless -e $dir;
sub run {
my ($cmd) = @_;
print "$cmd\n";
system $cmd;
}
for my $config (@config_files) {
my $cmd = "ln -sf $dir/config/$config";
# If the config file already exists, backer up
if( -e $config){
rename $config, "$config.bak.$$";
}
run($cmd);
}
# We don't clobber already existing directories
for my $config (@config_dirs) {
my $cmd = "ln -s $dir/config/$config";
run($cmd);
}
# crappy
run("ln -s $dir/bin");
print "Duke Leto environment deployed\n";