forked from thesharp/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate.sh
executable file
·72 lines (65 loc) · 1.51 KB
/
update.sh
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/sh
OS=`uname`
function dotfile {
if [ -f $HOME/.$1 ] ; then
if [ -L $HOME/.$1 ] ; then
echo "File already linked: $1"
else
echo "File exists: $1. Probably you want to remove it and run update.sh again."
fi
else
ln -s $HOME/dotfiles/$1 $HOME/.$1
echo "Linking file $1"
fi
}
function dotlaunchagent {
if [ -f $HOME/Library/LaunchAgents/$1 ] ; then
if [ -L $HOME/Library/LaunchAgents/$1 ] ; then
echo "LaunchAgent already linked: $1"
else
echo "LaunchAgent exists: $1. Probably you want to remove it and run update.sh again."
fi
else
ln -s $HOME/dotfiles/LaunchAgents/$1 $HOME/Library/LaunchAgents/$1
echo "Linking file $1"
fi
}
function dotdir {
if [ -d $HOME/.$1 ] ; then
if [ -L $HOME/.$1 ] ; then
echo "Directory already linked: $1"
else
echo "Directory exists: $1. Probably you want to remove it and run update.sh again."
fi
else
ln -s $HOME/dotfiles/$1 $HOME/.$1
echo "Linking directory $1"
fi
}
function dotconfigdir {
if [ -d $HOME/.config/$1 ] ; then
if [ -L $HOME/.config/$1 ] ; then
echo "Directory already linked: .config/$1"
else
echo "Directory exists: .config/$1. Probably you want to remove it and run update.sh again."
fi
else
ln -s $HOME/dotfiles/$1 $HOME/.config/$1
echo "Linking directory .config/$1"
fi
}
# Common
dotfile vimrc
dotfile gitconfig
dotfile zshrc
dotfile tmux.conf
dotfile latexmkrc
dotdir vim
dotdir tmux
dotdir zsh
dotconfigdir ranger
# Linux-specific
if [ $OS == "Linux" ] ; then
dotfile Xresources
dotdir mplayer
fi