-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·50 lines (33 loc) · 774 Bytes
/
install.sh
File metadata and controls
executable file
·50 lines (33 loc) · 774 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
#
# Installs Dotfiles
#
# prechecks
echo -ne "Git username: "
read gituser
echo -ne "Git email: "
read gitemail
BASE=$HOME/.mjwdotfiles
rm -rf $BASE
mkdir $BASE
# move out the home files
for file in home/*; do
echo "moving $file to $HOME."
cp $file $HOME/.$(basename $file)
done
# move out themes
mkdir -p ~/.emacs.d/themes
cp themes/* ~/.emacs.d/themes
# move out the subfiles
for file in mjwdotfiles/*; do
echo "moving $file to $BASE."
cp $file $BASE/
done
# update git credentials
sed -i "s/GITNAME/$gituser/" ~/.gitconfig
sed -i "s/GITEMAIL/$gitemail/" ~/.gitconfig
# tell .bashrc to source my bash
if [[ "$(grep mjwdotfiles ~/.bashrc)" == "" ]]; then
echo "updating .bashrc"
echo "source $BASE/bash" >> ~/.bashrc
fi