-
Notifications
You must be signed in to change notification settings - Fork 40
/
rbricks
executable file
·69 lines (65 loc) · 1.66 KB
/
rbricks
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
#!/bin/bash
if [ "$1" = "-n" ] || [ "$1" = "--new" ]
then
rails_create
elif [ "$1" = "-D" ] || [ "$1" = "--destroy" ]
then
rails_destroy
elif [ "$1" = "-r" ] || [ "$1" = "--recreate-db" ]
then
rails_db_recreate
elif [ "$1" = "-v" ] || [ "$1" = "--versions" ]
then
echo
echo "RailsBricks 1.0.3 (stable) by Nico Schuele <[email protected]>"
echo "http://www.railsbricks.net"
echo
elif [ "$1" = "--update" ]
then
echo
echo "----> Getting latest version from Github ..."
echo
cd ~/railsbricks/
git pull https://github.com/nicoschuele/railsbricks.git
echo
echo "----> RailsBricks is up to date."
echo
else
echo
echo
echo "************************************************"
echo "* RailsBricks v1.0.3 *"
echo "* ------------------ *"
echo "* http://www.railsbricks.net *"
echo "************************************************"
echo
echo "1) Create a new Rails app"
echo "2) Destroy a Rails app"
echo "3) Recreate database"
echo "4) Shortcuts"
echo "5) Exit"
echo -n ": "
read CHOICE
if [ "$CHOICE" = "1" ]
then
rails_create
elif [ "$CHOICE" = "2" ]
then
rails_destroy
elif [ "$CHOICE" = "3" ]
then
rails_db_recreate
elif [ "$CHOICE" = "4" ]
then
echo
echo "rbricks -n (or rbricks --new):"
echo " - creates a new Rails app with RailsBricks templates"
echo "rbricks -D (or rbricks --destroy):"
echo " - destroys a Rails app and its RVM gemset"
echo "rbricks -r (or rbricks --recreate-db):"
echo " - drop, migrate and seed the development database"
echo
else
exit 1
fi
fi