summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemsen2011-04-21 10:09:38 +0200
committerGravatar Tom Willemsen2011-04-21 10:09:38 +0200
commita213efb4aad0d032b80811214fcb093e910c6ee0 (patch)
tree7e426b46b71494af6e25e669833b6c66f44fa6c4
parent6c769687be114f1e501a42b426013a46ebfcd983 (diff)
downloaddotfiles-a213efb4aad0d032b80811214fcb093e910c6ee0.tar.gz
dotfiles-a213efb4aad0d032b80811214fcb093e910c6ee0.zip
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.
-rwxr-xr-xinstall.sh31
1 files changed, 27 insertions, 4 deletions
diff --git a/install.sh b/install.sh
index 77b8436..a3bdd98 100755
--- a/install.sh
+++ b/install.sh
@@ -9,8 +9,30 @@ CMD="ln -sfn"
function linkmy
{
- echo "Linking $INSTALL_BASEDIR/$1 to $HOME/$2"
- $CMD $INSTALL_BASEDIR/$1 $HOME/$2
+ install_file=$INSTALL_BASEDIR/$1
+ 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
@@ -19,14 +41,15 @@ function copymy
cp $INSTALL_BASEDIR/$1 $HOME/$2
}
-# AWESOME
-linkmy config/awesome .config/awesome
# CONKY
linkmy conkyrc .conkyrc
copymy conky_box.lua .conky_box.lua
# EMACS
linkmy emacs .emacs
linkmy emacs.d .emacs.d
+# GIT
+linkmy gitconfig .gitconfig
+linkmy git.d .git.d
# IRSSI
linkmy irssi .irssi
# MUTT