-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·53 lines (46 loc) · 1.42 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·53 lines (46 loc) · 1.42 KB
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
#!/bin/bash
set -e
GREEN="$(tput setaf 2)"
RESET="$(tput sgr0)"
# Installs @mass's configuration for zsh, bash, vim, and more.
DOTDIR=$(pwd)
VIMDIR=$(pwd)/vim
BASHDIR=$(pwd)/bash
ZSHDIR=$(pwd)/zsh
# Installs bashrc, zshrc
echo "${GREEN}Installing bashrc, zshrc${RESET}"
ln -i -s $BASHDIR/bashrc ~/.bashrc
ln -i -s $BASHDIR/bash_profile ~/.bash_profile
ln -i -s $ZSHDIR/zshrc ~/.zshrc
# Installs vim
echo "${GREEN}Installing vim${RESET}"
ln -i -s $VIMDIR/vimrc.vim ~/.vimrc
if [ -h ~/.vim ]; then
rm ~/.vim
fi
ln -i -s "$VIMDIR" ~/.vim
ln -i -s ~/.vim/mass_airline.vim ~/.vim/plug/vim-airline/autoload/airline/themes/mass_airline.vim
# Installs .gitconfig, .toprc, .tmux.conf, etc.
echo "${GREEN}Installing config files${RESET}"
if [ ! -d ~/.config ]; then
mkdir ~/.config
fi
ln -i -s $DOTDIR/gitconfig ~/.gitconfig
ln -i -s $DOTDIR/toprc ~/.toprc
ln -i -s $DOTDIR/tigrc ~/.tigrc
ln -i -s $DOTDIR/tmux.conf ~/.tmux.conf
# Get command line options
while getopts "o" opt; do
case $opt in
o)
# Replace remotes with read-only URLs for other users.
cd $DOTDIR
echo "${GREEN}Replace with read-only remotes${RESET}"
sed -i '' "s/git@github.com:/git:\/\/github.com\//" .gitmodules
;;
esac
done
# Pulls down submodules recursively
echo "${GREEN}Pull down submodules recursively${RESET}"
git submodule update --init --recursive
git submodule foreach --recursive "(git checkout master && git pull --ff origin master)"