-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathroboconf.sh
54 lines (45 loc) · 1.14 KB
/
roboconf.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
function roboconf-check {
local dependency="$1"
echo -n "checking for $dependency... "
# See also: [Check if a program exists from a bash script](http://stackoverflow.com/questions/592620/check-if-a-program-exists-from-a-bash-script)
hash "$dependency" 2>&- || {
echo 'no'
exit -1
}
echo 'yes'
}
function roboconf-git-modules {
roboconf-check git
git submodule init
git submodule sync
git submodule update
}
function roboconf-bundler {
local bundler_version="$1"
local opts="$2"
roboconf-check rvm
roboconf-check gem
# Assumes rvm
gem install bundler --version "$bundler_version" --no-rdoc --no-ri
bundle install $opts
}
function roboconf-npm {
roboconf-check node
roboconf-check npm
npm install
}
function roboconf-rails-activerecord {
bundle exec rake db:create
bundle exec rake db:migrate
}
function roboconf-padrino-activerecord {
bundle exec padrino rake ar:create
bundle exec padrino rake ar:create -e test
bundle exec padrino rake ar:migrate
bundle exec padrino rake ar:migrate -e test
bundle exec padrino rake seed
}
function roboconf-passenger {
mkdir -p tmp
touch tmp/restart.txt
}