-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall
More file actions
executable file
·40 lines (32 loc) · 1007 Bytes
/
install
File metadata and controls
executable file
·40 lines (32 loc) · 1007 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
32
33
34
35
36
37
38
39
40
#!/bin/bash
#only works in Linux, but I don't need to be portable here.
MY_EXE=`readlink -f $0`
MY_DIR=`dirname ${MY_EXE}`
echo Discovered install directory: ${MY_DIR}
SETTINGS_FILE=${MY_DIR}/install_settings.cfg
if [[ -f ${SETTINGS_FILE} ]]; then
echo Loading local settings from ${SETTINGS_FILE}
. ${SETTINGS_FILE}
fi
LN_FILES="${LN_FILES}
.vimrc
.vim
.bash_aliases
.bash_aliases.local
.gitconfig
gitignore;.gitignore
.autotest
subversion/config;.subversion/config"
for file_spec in ${LN_FILES}; do
src_file=$(echo $file_spec | cut -f1 -d';')
dst_file=$(echo $file_spec | cut -f2 -d';')
full_path=${MY_DIR}/$src_file
if [[ -e $full_path ]]; then
echo Symlinking $full_path to ~/$dst_file
if [[ ! -d `dirname $dst_file` ]]; then
mkdir -p `dirname $dst_file`
fi
rm -f ~/$dst_file
ln -s $full_path ~/$dst_file
fi
done