INSTALL: linking

Since linking creates trouble in some cases I've added some more
detail to the function, showing me if they do it or not and such.
This commit is contained in:
Tom Willemsen 2011-04-21 10:09:38 +02:00
parent 6c769687be
commit a213efb4aa

View file

@ -9,8 +9,30 @@ CMD="ln -sfn"
function linkmy function linkmy
{ {
echo "Linking $INSTALL_BASEDIR/$1 to $HOME/$2" install_file=$INSTALL_BASEDIR/$1
$CMD $INSTALL_BASEDIR/$1 $HOME/$2 home_file=$HOME/$2
if [ -f $install_file ]
then
if [ ! -f $home_file ]
then
echo "Linking $install_file to $home_file"
$CMD $install_file $home_file
else
echo "$home_file already exists."
fi
elif [ -d $install_file ]
then
if [ ! -d $home_file ]
then
echo "Linking $install_file/ to $home_file/"
$CMD $install_file $home_file
else
echo "$home_file already exists."
fi
else
echo "Couldn't find $install_file"
fi
} }
function copymy function copymy
@ -19,14 +41,15 @@ function copymy
cp $INSTALL_BASEDIR/$1 $HOME/$2 cp $INSTALL_BASEDIR/$1 $HOME/$2
} }
# AWESOME
linkmy config/awesome .config/awesome
# CONKY # CONKY
linkmy conkyrc .conkyrc linkmy conkyrc .conkyrc
copymy conky_box.lua .conky_box.lua copymy conky_box.lua .conky_box.lua
# EMACS # EMACS
linkmy emacs .emacs linkmy emacs .emacs
linkmy emacs.d .emacs.d linkmy emacs.d .emacs.d
# GIT
linkmy gitconfig .gitconfig
linkmy git.d .git.d
# IRSSI # IRSSI
linkmy irssi .irssi linkmy irssi .irssi
# MUTT # MUTT