This repository has been archived by the owner on May 17, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
bootstrap.sh
executable file
·136 lines (118 loc) · 3.89 KB
/
bootstrap.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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#!/bin/bash
# This file is part of the clacks framework.
#
# http://clacks-project.org
#
# Copyright:
# (C) 2010-2012 GONICUS GmbH, Germany, http://www.gonicus.de
#
# License:
# GPL-2: http://www.gnu.org/licenses/gpl-2.0.html
#
# See the LICENSE file in the project's top-level directory for details.
HERE=$(pwd)
prepare_clacks() {
cd $HERE
echo -n "Creating virtual environment: "
virtualenv --setuptools --system-site-packages clacks &> /dev/null && echo ok
if virtualenv --help | grep -q -- --setuptools; then
virtualenv --system-site-packages --setuptools clacks &> /dev/null && echo ok
else
virtualenv --system-site-packages clacks &> /dev/null && echo ok
fi
if [ $? -ne 0 ]; then
echo "failed"
exit 1
fi
echo -n "Cloning from git://github.com/clacks/clacks.git: "
git clone git://github.com/gonicus/clacks.git clacks/src &> /dev/null && echo ok
if [ $? -ne 0 ]; then
echo "failed"
exit 1
fi
cd $HERE/clacks
source bin/activate
for component in common shell agent; do
echo -n "Deploying component '$component': "
cd $HERE/clacks/src/$component
./setup.py develop &> /dev/null && echo ok
if [ $? -ne 0 ]; then
echo "failed"
exit 1
fi
done
deactivate
cd $HERE
}
prepare_vim() {
echo -n "Installing 'vundle': "
git clone http://github.com/gmarik/vundle.git ~/.vim/bundle/vundle && echo ok
if [ $? -ne 0 ]; then
echo "failed"
exit 1
fi
cat <<EOF > ~/.vimrc
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let g:Powerline_symbols = 'fancy'
let g:Powerline_symbols = 'unicode'
set laststatus=2
set encoding=utf-8 " Necessary to show unicode glyphs
set t_Co=256 " Explicitly tell vim that the terminal supports 256 colors
syntax on
set nofoldenable
" let Vundle manage Vundle
" required!
Bundle 'gmarik/vundle'
" My Bundles here:
"
" original repos on github
Bundle 'Lokaltog/vim-powerline'
Bundle 'sophacles/vim-bundle-python'
Bundle 'tpope/vim-fugitive'
Bundle 'Lokaltog/vim-easymotion'
Bundle 'rstacruz/sparkup', {'rtp': 'vim/'}
Bundle 'tpope/vim-rails.git'
" vim-scripts repos
Bundle 'L9'
Bundle 'FuzzyFinder'
" non github repos
Bundle 'git://git.wincent.com/command-t.git'
" ...
filetype plugin indent on " required!
"
" Brief help
" :BundleList - list configured bundles
" :BundleInstall(!) - install(update) bundles
" :BundleSearch(!) foo - search(or refresh cache first) for foo
" :BundleClean(!) - confirm(or auto-approve) removal of unused bundles
"
" see :h vundle for more details or wiki for FAQ
" NOTE: comments after Bundle command are not allowed..
EOF
vim +BundleInstall +qall
}
if [ ! -d $HERE/clacks ]; then
read -s -i y -n 1 -p "There is no clacks virtual environment available, do you want me to
create one for you? [Yn]" prmpt
echo
if [ -z "$prmpt" -o "$prmpt" = "y" ]; then
prepare_clacks
fi
fi
if [ ! -f $HERE/.vimrc ]; then
read -s -i y -n 1 -p "There is no vim configuration installed. Do you want me to configure
vim for python? [Yn]" prmpt
echo
if [ -z "$prmpt" -o "$prmpt" = "y" ]; then
prepare_vim
fi
fi
if [ -d $HERE/clacks ]; then
echo "Found virtual clacks environment - activating it..."
cd $HERE/clacks
source bin/activate
cd $HERE
fi