-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.sh
executable file
·97 lines (84 loc) · 2.22 KB
/
start.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
function pause(){
read -p "$*"
}
# Rename, to remove some text from middle of filenames:
# brew install rename
# sudo apt -y install rename
# rename 's|.i18n||g' *
echo
PS3='Please enter your choice: '
options=("Install WeKan dependencies" "Update" "Run WeKan for dev at http://localhost:3000" "Run WeKan for production at port 3000" "Pull all translations" "Push English base translation" "Push translation" "Rubocop auto correct all" "Quit")
select opt in "${options[@]}"
do
case $opt in
"Install WeKan dependencies")
if [[ "$OSTYPE" == "linux-gnu" ]]; then
echo "Linux";
sudo apt -y install build-essential ruby-full ruby-dev libyaml-dev sqlitebrowser nano
sudo gem install bundler -v 2.4.22
sudo gem install rails
sudo gem update
sudo bundle update
sudo bundle install
elif [[ "$OSTYPE" == "darwin"* ]]; then
echo "macOS";
brew install ruby@3.2 sqlite sqlite-utils db-browser-for-sqlite libyaml nano
gem uninstall bundler --all
gem install bundler
gem install rails
gem update
bundle update
bundle install
fi
echo Done.
break
;;
"Update")
gem update
bundle update
echo Done
break
;;
"Run WeKan for dev at http://localhost:3000")
bin/rails db:migrate
bundle exec rake assets:precompile
./bin/rails server
echo Done.
break
;;
"Run WeKan for production at port 3000")
bin/rails db:migrate
bundle exec rake assets:precompile
./bin/rails server -e production
echo Done.
break
;;
"Pull all translations")
tx --config .tx/config pull -a -f
# https://developers.transifex.com/docs/cli
# New Go-based transifex client.
echo Done.
break
;;
"Push English base translation")
tx push -s
echo Done.
break
;;
"Push translation")
read -p "Translation to push: " translation
tx push -t -l "$translation"
echo Done.
break
;;
"Rubocop auto correct all")
rubocop -A
echo Done.
break
;;
"Quit")
break
;;
*) echo invalid option;;
esac
done