-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·31 lines (26 loc) · 845 Bytes
/
install.sh
File metadata and controls
executable file
·31 lines (26 loc) · 845 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
# back up files if necessary but only if not linking
function testandlink
{
SOURCE=$1
DEST=$2
# check existence
if [ -e "$DEST" ] ; then
# if it exists, check if it is a symlink and to the source
if ! [ -L "$DEST" ] ; then
echo "Backing up ${DEST}"
cp $DEST ${DEST}.bac
fi
fi
echo "linking $SOURCE to $DEST"
ln -sf $SOURCE $DEST
}
DIR=$( cd $( dirname "${BASH_SOURCE[0]}" ) && pwd )
testandlink ${DIR}/vimrc ~/.vimrc
testandlink ${DIR}/vimrc ~/.config/nvim/init.vim
testandlink ${DIR}/bashrc ~/.bashrc
testandlink ${DIR}/xmonad.hs ~/.xmonad/xmonad.hs
testandlink ${DIR}/juliarc.jl ~/.juliarc.jl
testandlink ${DIR}/mygitcheck.py ~/mygitcheck.py
testandlink ${DIR}/clang-format ~/.clang-format
testandlink ${DIR}/setup_conda.env ~/setup_conda.env