-
Notifications
You must be signed in to change notification settings - Fork 0
/
mo-dev
executable file
·83 lines (69 loc) · 1.82 KB
/
mo-dev
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
#!/bin/bash
dir=$1
if [ ! $dir ]; then
echo "Usage: mo-dev <dir>"
exit
fi
if [ ! -d /home/vagrant/.rvm ]; then
echo Installing RVM
curl -L https://get.rvm.io | bash -s stable
source /home/vagrant/.rvm/scripts/rvm
else
echo RVM installed
fi
cd $dir
if [ ! $? -eq 0 ]; then
echo "Destination directory, " $dir ", doesn't exist!"
exit
fi
if [ ! -d mushroom-observer ]; then
git clone https://github.com/MushroomObserver/mushroom-observer.git
fi
cd mushroom-observer
rvm install `cat .ruby-version`
mysql -u mo -pmo mo_development -e ''
if [ ! $? -eq 0 ]; then
mysql -u root -proot < db/initialize.sql
mysql -u mo -pmo mo_development < db/vagrant/init.sql
echo Created and populated mo_development database
else
echo mo_development exists
fi
if [ ! -f config/database.yml ]; then
cp db/vagrant/database.yml config
echo Copied config/database.yml
else
echo database.yml exists
fi
for dir in thumb 320 640 960 1280 orig;
do
if [ ! -d public/images/$dir ]; then
mkdir public/images/$dir
echo Created public/images/$dir
else
echo public/images/$dir exists
fi
done
if [ ! -f /usr/local/bin/jpegresize ]; then
sudo gcc script/jpegresize.c -ljpeg -lm -O2 -o /usr/local/bin/jpegresize
echo Created and installed jpegresize executable
else
echo jpegresize exists
fi
if [ ! -f /usr/local/bin/jpegexiforient ]; then
sudo gcc script/jpegexiforient.c -o /usr/local/bin/jpegexiforient
echo Created and installed jpegexiforient executable
else
echo jpegexiforient exists
fi
if [ ! -f /usr/local/bin/exifautotran ]; then
sudo cp script/exifautotran.sh /usr/local/bin/exifautotran;
sudo chmod 755 /usr/local/bin/exifautotran
echo Installed exifautotran script
else
echo exifautotran exists
fi
git pull
bundle install
rake db:migrate
rake lang:update