First version of install script

vimbundler
nirenjan 2013-05-02 21:47:06 -07:00
parent 9d02e9d8d0
commit 00991e9d89
1 changed files with 29 additions and 0 deletions

29
install 100755
View File

@ -0,0 +1,29 @@
#!/bin/sh
# Install file to destination folder
insfile()
{
rsync -av "$DF_PATH/$1" "$2"
}
# Symlink file to destination folder
lnfile()
{
FILE_PATH=$(dirname $2)
FILE_NAME=$(basename $2)
echo pushd $FILE_PATH
pushd $FILE_PATH
echo ln -s "$DF_PATH/$1" $FILE_NAME
ln -s "$DF_PATH/$1" $FILE_NAME
echo popd
popd
}
# Install scripts to corresponding destination folders
cd $(dirname $0)
DF_PATH=$(pwd)
PRINT_PATH=$(echo $DF_PATH | sed "s:^$HOME:~:")
echo Installing dotfiles from $PRINT_PATH
# Install vim files
lnfile vimrc ~/.vimrc