-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·33 lines (27 loc) · 823 Bytes
/
install.sh
File metadata and controls
executable file
·33 lines (27 loc) · 823 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
#!/bin/bash
# Installation on a clean machine
destdir=$HOME # install to $HOME by default, override with HOME=... install.sh
cd `dirname $0` # chdir to where the files are
here=`pwd`
function link() {
dest=$destdir/$1
[ -L $dest ] && { echo "skip $dest"; return; }
[ -f $dest -o -d $dest ] && { echo "already exists: $dest" ; return; }
[ -e $dest ] || { ln -vs $here/$1 `dirname $dest` ; }
}
for name in `find . -maxdepth 1 -not -not -iname .hg \
-not -name .ssh -not -iname install.sh -not -name . -not -name .hgignore`
do
link $name
done
[ -d ~/.ssh ] || { mkdir ~/.ssh && chmod 700 ~/.ssh; }
link .ssh/config
link .bashrc
link .gitconfig
link .gitignore
link .screenrc
link .ssh
link .vim
link .vimrc
# OLD: plain tar/cp
# tar cvf - . --exclude=.hg --exclude=install.sh | (cd $destdir && tar xf -)