-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·63 lines (55 loc) · 1.32 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
#!/usr/bin/env bash
MYDIR=`cd $(dirname $0); pwd`
update_submodules() {
echo "Updating submodules in ${MYDIR}"
pushd "$MYDIR"
git submodule update --init
popd
}
symlink_files() {
echo "Setting up dotfiles from ${MYDIR}"
for file in .bashrc .inputrc .profile .rubocop.yml .vim .vimrc
do
ln -nsf "${MYDIR}/${file}" ~
done
mkdir -p ${HOME}/bin
for file in ${MYDIR}/bin/*
do
ln -nsf ${file} ~/bin
done
}
run_vundle() {
vim -u ~/.vim/bundles.vim +BundleInstall +qall
}
configure_git() {
echo "Configuring git"
ln -nsf "${MYDIR}/gitignore" ~/.gitignore
[ -e ~/.gitconfig ] || cp "${MYDIR}/.gitconfig" ~
}
configure_plover() {
# TODO: add support for Linux
if [ `uname -s` = "Darwin" ]
then
plover_bin='/Applications/Plover.app/Contents/MacOS/Plover'
plover_files="${HOME}/Library/Application Support/plover"
if [ ! -e "${plover_bin}" ]
then
echo "Plover installation not detected"
return 1
fi
if [ -z "`which plover`" ]
then
echo "Setting up plover wrapper"
(echo "#!/bin/sh"; echo "exec '${plover_bin}' \"\$@\"") >~/bin/plover
chmod +x ~/bin/plover
fi
echo "Symlinking plover config files"
mkdir -p "${plover_files}"
ln -nsfv ${MYDIR}/plover/* "${plover_files}"
fi
}
update_submodules
symlink_files
configure_git
run_vundle
configure_plover