-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathbootstrap.generic.sh
executable file
·115 lines (102 loc) · 3.24 KB
/
bootstrap.generic.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#!/bin/bash
set -eo pipefail
CURRDIR=`pwd`
SCRIPTDIR=$(cd `dirname $0` && pwd)
. ${SCRIPTDIR}/config.sh
# setup prezto
echo
echo 'setting up prezto'
cd ~
[[ ! -d .zprezto ]] && git clone --recursive https://github.com/sorin-ionescu/prezto.git "${HOME}/.zprezto"
[[ ! -L .zlogin ]] && ln -s .zprezto/runcoms/zlogin .zlogin
[[ ! -L .zlogout ]] && ln -s .zprezto/runcoms/zlogout .zlogout
[[ ! -L .zprofile ]] && ln -s .zprezto/runcoms/zprofile .zprofile
[[ ! -L .zshenv ]] && ln -s .zprezto/runcoms/zshenv .zshenv
cd .zprezto
git pull
git submodule update --init --recursive
mkdir -p contrib
cd contrib
[[ ! -d fzf-tab ]] && git clone https://github.com/Aloxaf/fzf-tab
cd fzf-tab
git pull
# create links
echo
echo 'symlinking dotfiles'
cd ~
[[ ! -L .gitconfig ]] && ln -s ${SCRIPTDIR}/gitconfig .gitconfig
[[ ! -L .git-global-ignore ]] && ln -s ${SCRIPTDIR}/git-global-ignore .git-global-ignore
[[ ! -L .p10k.zsh ]] && ln -s ${SCRIPTDIR}/p10k.${BOOTSTRAP_OS}.zsh .p10k.zsh
[[ ! -L .zpreztorc ]] && ln -s ${SCRIPTDIR}/zpreztorc .zpreztorc
[[ ! -L .zshrc ]] && ln -s ${SCRIPTDIR}/zshrc .zshrc
[[ ! -L ".zshrc.${BOOTSTRAP_OS}" ]] && ln -s ${SCRIPTDIR}/zshrc.${BOOTSTRAP_OS} .zshrc.${BOOTSTRAP_OS}
[[ -f "${SCRIPTDIR}/zshrc.${LINUX_DISTRO}" && ! -L ".zshrc.${LINUX_DISTRO}" ]] && ln -s ${SCRIPTDIR}/zshrc.${LINUX_DISTRO} .zshrc.${LINUX_DISTRO}
mkdir -p .config
cd .config
[[ ! -L nvim ]] && ln -s ${SCRIPTDIR}/config/nvim nvim
[[ ! -L tmux ]] && ln -s ${SCRIPTDIR}/config/tmux tmux
[[ ! -L ripgrep ]] && ln -s ${SCRIPTDIR}/config/ripgrep ripgrep
cd ~
mkdir -p .cargo
cd .cargo
[[ ! -L config.toml ]] && ln -s $SCRIPTDIR/cargo-config.toml config.toml
# create links for custom scrips
echo
echo 'symlinking custom scripts'
cd ~
mkdir -p bin
cd bin
for f in $(find ${SCRIPTDIR}/bin -maxdepth 1 -type f); do
[[ ! -L $(basename ${f}) ]] && ln -s ${f}
done
if [[ -d ${SCRIPTDIR}/bin/${BOOTSTRAP_OS} ]]; then
for f in $(find ${SCRIPTDIR}/bin/${BOOTSTRAP_OS} -type f); do
[[ ! -L $(basename ${f}) ]] && ln -s ${f}
done
fi
if [[ ! -z ${LINUX_DISTRO} && -d ${SCRIPTDIR}/bin/linux/${LINUX_DISTRO} ]]; then
for f in $(find ${SCRIPTDIR}/bin/linux/${LINUX_DISTRO} -type f); do
[[ ! -L $(basename ${f}) ]] && ln -s ${f}
done
fi
# run os-specific shit
echo
echo "bootstrapping ${BOOTSTRAP_OS}"
${SCRIPTDIR}/bootstrap.${BOOTSTRAP_OS}.sh
# clean/install/update tmux plugins
export XDG_CONFIG_DIR=${HOME}/.config
echo
echo 'installing and updating tmux plugins'
~/.config/tmux/plugins/tpm/bin/clean_plugins
~/.config/tmux/plugins/tpm/bin/install_plugins
~/.config/tmux/plugins/tpm/bin/update_plugins all
# make code dir
mkdir -p ~/code
# run company-specific shit
if [ "$1" = "airbnb" ]; then
echo
echo "bootstrapping airbnb"
cd ~
mkdir -p code/ghe/jigish-patel
cd code/ghe/jigish-patel
[[ ! -d dotfiles ]] && git clone git@git.musta.ch:jigish-patel/dotfiles.git
cd dotfiles
git pull
./bootstrap.sh
fi
cd $CURRDIR
TMP_TODO="none"
if [[ -f ${HOME}/tmp/bootstrap_TODO ]]; then
TMP_TODO=$(cat ${HOME}/tmp/bootstrap_TODO)
rm -f ${HOME}/tmp/bootstrap_TODO
fi
echo
echo
echo
echo "bootstrap done."
echo
#echo "things to do manually:"
#echo
#echo "- install nord brave/chrome theme:"
#echo " - https://chrome.google.com/webstore/detail/nord/abehfkkfjlplnjadfcjiflnejblfmmpj?hl=en"
echo ${TMP_TODO}