summaryrefslogtreecommitdiff
path: root/make-symlinks
blob: 9581e59734bc4ae9f66aae03495cc1b096d7d708 (plain)
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
#!/bin/sh

set -e

die() {
	echo "$@" 1>&2
	exit 1
}

abspath() {
	(cd "$1" && pwd)
}

dirname="$(abspath "$(dirname "$0")")"
echo "$dirname"

files="
    abcde.conf
    bash_profile
    bashrc
    emacs.d
    git-global-ignore
    mailcap
    profile
    screenrc
    signature
    signature-codethink
    taskrc
    tmux.conf
    vimrc
    xsessionrc
    ssh/config
    ssh/config-pers
"

install -d "$HOME/.config"
for x in $files; do
	[ -e "$dirname/$x" ] || die "$dirname/$x does not exist, oops"
	#    [ ! -L "$HOME/.$x" ] || die "$HOME/.$x is already a symlink, oops"
done

for x in $files; do
	ln -sf "$dirname/$x" "$HOME/.$x"
done