-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathalpaca
More file actions
executable file
·78 lines (58 loc) · 1.66 KB
/
alpaca
File metadata and controls
executable file
·78 lines (58 loc) · 1.66 KB
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
#!/bin/bash
ORANGE="\033[38;5;208m"
CLEAR="\033[0;00m"
echo -e "$ORANGE Alpaca says: Updating system... $CLEAR"
sudo apt-get update 1> /dev/null
if [ $? -ne 0 ]
then
echo "Something went wrong when updating."
exit 1
fi
# installing PGP v2
echo -e "$ORANGE Alpaca says: installing PGP v2... $CLEAR"
sudo apt-get install gnupg2 -y 2> /dev/null
if [ $? -ne 0 ]
then
echo "Something went wrong when installing PGP v2." >&2
exit 1
fi
# upgrading RVM
echo -e "$ORANGE Alpaca says: Upgrading RVM... $CLEAR"
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB 2> /dev/null
sudo rvm get stable 2> /dev/null
if [ $? -ne 0 ]
then
echo "Something went wrong when upgrading RVM." >&2
exit 1
fi
# need to reload to use rvm
rvm reload > /dev/null
echo -e "$ORANGE Alpaca says: Installing ruby 2.4.1 $CLEAR"
rvm install 2.4.1 2> /dev/null
if [ $? -ne 0 ]
then
echo "Something went wrong when installing ruby 2.4.1." >&2
exit 1
fi
# need to include script first
source /usr/local/rvm/scripts/rvm
rvm use 2.4.1 --default > /dev/null
rvm gemset create rails5.1 --default > /dev/null
rvm use 2.4.1@rails5.1 --default > /dev/null
echo -e "$ORANGE Alpaca says: Installing rails 5.1 $CLEAR"
gem install rails -v 5.1 2> /dev/null
if [ $? -ne 0 ]
then
echo "Something went wrong when installing rails 5.1." >&2
exit 1
fi
echo -e "$ORANGE Alpaca says: Installing yarn... $CLEAR"
npm install --global yarn
if [ $? -ne 0 ]
then
echo "Something went wrong when installing yarn." >&2
exit 1
fi
echo -e "Clear command files"
rm -rf alpaca-command
echo -e "\033[38;5;40mSuccess! Have fun coding! $CLEAR"