-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·72 lines (56 loc) · 1.15 KB
/
install.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/bash
#
current_user=`whoami`
install_directory() {
local from_dir=$1
local to_dir=$2
local base_dir=$(dirname $to_dir)
if [ ! -w $base_dir ]; then
sudo mkdir -p $to_dir
sudo chown $current_user $base_dir
fi
if [ ! -d $to_dir ]; then
mkdir -p $to_dir
fi
for f in `ls $from_dir`
do
echo "Installing $to_dir/$f"
cp -R $from_dir/$f $to_dir/
done
}
install_file() {
local from_file=$1
local to_file=$2
echo "Installing file $to_dir/$f"
cp $from_file $to_file
}
# Get the latest submodules.
git submodule update --init
if [ ! -d ~/.config/nvim ]; then
mkdir -p ~/.config/nvim
fi
install_directory ./nvim ~/.config/nvim
install_directory ./scripts ~/scripts
install_directory ./dots/config ~/.config
#
# Install all the emacs modes.
#
mkdir -p ~/.emacs.d/modes
for f in `ls emacs/rspec-mode/*.el`
do
install_file $f ~/.emacs.d/modes/
done
for f in `ls emacs/ruby-mode/*.el`
do
install_file $f ~/.emacs.d/modes/
done
for f in `ls emacs/emacs-starter-kit/*.el`
do
install_file $f ~/.emacs.d/modes/
done
for f in `ls ./dots`;
do
echo "Installing .$f"
cp -r ./dots/$f $HOME/.$f
done
source ~/.bashrc