This repository has been archived by the owner on Feb 8, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
81 lines (63 loc) · 2.18 KB
/
install.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
#!/bin/bash
cd "$(cd -P -- "$(dirname -- "$0")" && pwd -P)"
if [[ `uname` == 'Darwin' ]]; then
echo "Installing homebrew..."
echo "-------------------------------------------------------------------------------"
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
echo "Installing ssh-copy-id..."
echo "-------------------------------------------------------------------------------"
brew install ssh-copy-id
fi
echo "Downloading GPG public key..."
echo "-------------------------------------------------------------------------------"
. "bin/recv-keys.sh"
echo "Installing rvm..."
echo "-------------------------------------------------------------------------------"
if ! command -v curl >/dev/null 2>&1 ; then
echo "Could not find curl. Please install 'curl' and try again."
exit
else
curl -sSL https://get.rvm.io | bash -s stable --auto-dotfiles
fi
echo "Configuring environment..."
echo "-------------------------------------------------------------------------------"
export PATH="$PATH:$HOME/.rvm/bin"
if [[ $EUID -ne 0 ]]; then
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
else
[[ -s "/etc/profile.d/rvm.sh" ]] && source "/etc/profile.d/rvm.sh"
fi
#### "Installing ruby / gems..."
#### "-------------------------------------------------------------------------------"
. "bin/install_ruby.sh"
echo "Enabling bash auto-completion..."
echo "-------------------------------------------------------------------------------"
promptyn() {
while true; do
read -p "$1 " yn
case $yn in
[Yy]* ) return 0;;
[Nn]* ) return 1;;
* ) echo "Please answer yes or no.";;
esac
done
}
if promptyn "Do you wish to enable bash auto-completion?"; then
rvm lisk-rake-ruby@lisk-rake do ruby "bin/completer.rb" --enable
profiles=("$HOME/.bash_profile" "$HOME/.profile")
for i in ${profiles[@]}; do
if [ -f $i ]; then
source $i
break
fi
done
echo ""
echo "* Bash auto-completion was enabled."
echo ""
else
echo ""
echo "* Bash auto-completion was not enabled."
echo ""
fi
echo "Done."
echo "-------------------------------------------------------------------------------"