-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·61 lines (44 loc) · 1018 Bytes
/
setup.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
#!/bin/bash
ln_opts=
INSERT_STR="source ~/.my_env"
function die {
echo >&2 "$@"
exit 1
}
#for debugging#
docmd(){
echo "Command: $*"
$*
}
if [ -z $HOME ]; then
echo HOME not set
die
fi
while getopts f opt
do
case $opt in
f) ln_opts="-f"
esac
done
#install dev programs
sudo apt install -y vim emacs gcc make screen gdb cscope
git config --global user.email "[email protected]"
git config --global user.name "Alex Speasmaker"
for file in `ls ./dotfiles`; do
if [ -L $HOME/.$file ]; then
continue
fi
if [ -e $HOME/.$file ]; then
echo .$file already exists in $HOME, run with -f to overwrite
continue
fi
ln -s $ln_opts $PWD/dotfiles/$file $HOME/.$file
done
grep -q -F "$INSERT_STR" $HOME/.bashrc
if [ $? -eq 1 ]; then
echo adding $INSERT_STR to end of .bashrc
echo $INSERT_STR >> $HOME/.bashrc
fi
sudo cp ./sudo/alex /etc/sudoers.d
mkdir ~/bin
ln -s $PWD/scripts/productive_mode $HOME/bin/productive_mode