-
Notifications
You must be signed in to change notification settings - Fork 2
/
install
executable file
·46 lines (37 loc) · 1.1 KB
/
install
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
41
42
43
44
45
46
#!/usr/bin/env bash
if [ -f ./install ]; then
# do not overwrite user .alias
if [ -f ~/.alias ] && [ ! -L ~/.alias ]; then
echo 'mv ~/.alias ~/.alias_bis'
mv ~/.alias ~/.alias_bis
fi
# do not overwrite user .zshenv
if [ -f ~/.zshenv ] && [ ! -L ~/.zshenv ]; then
echo 'mv ~/.zshenv ~/.zshenv_bis'
mv ~/.zshenv ~/.zshenv_bis
fi
# link everything
echo "INFO: linking (ln -fs) dotfiles in $1"
while read -r line; do
file=`echo $line | sed 's/ .*//g'`
dest=`echo $line | sed 's/.* //g'`
if [[ $dest == $file ]]; then
mkdir -p $HOME/`dirname $dest`
echo "=> ln -fs `pwd`/$file $HOME/`dirname $file`"
ln -fs `pwd`/$file $HOME/`dirname $file`
else
mkdir -p `dirname "${dest/#\~/$HOME}"`
echo "=> ln -fs `pwd`/$file $dest"
ln -fs `pwd`/$file "${dest/#\~/$HOME}"
fi
done < $1
# compile terminfos
echo "INFO: compiling terminfos"
for f in `ls terminfo`; do
echo "=> tic -x $f"
tic -x "terminfo/$f"
done
else
echo "ERROR: you must run this script within the .dotfiles directory!"
fi
# vim: tabstop=2 shiftwidth=2