-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathidris.sh
51 lines (40 loc) · 1.36 KB
/
idris.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
#!/bin/bash
# loading common utilities
source /home/vagrant/utils.sh
liquid_prompt() {
if [ ! -f ~/runonce ] #here the check is on the home directory
then
msg ':::: setting up liquidprompt to vagrant machine ::::'
msg "Installing liquidprompt..."
cd ~
git clone https://github.com/nojhan/liquidprompt.git
echo "Setting up liquidprompt to the .bashrc folder"
echo '# Only load Liquid Prompt in interactive shells, not from a script or from scp' >> ~/.bashrc
echo '[[ $- = *i* ]] && source ~/liquidprompt/liquidprompt' >> ~/.bashrc
touch ~/runonce #avoid script to be provisioned more than once
else
msg "::: liquidprompt already provisioned :::"
fi
}
idris() {
sudo add-apt-repository ppa:hvr/ghc --yes
sudo apt-get update
sudo apt-get install ghc-7.10.3 cabal-install-2.0 --yes
msg "GHC and Cabal installed"
export PATH=/opt/ghc/7.10.3/bin/:/opt/cabal/2.0/bin/:$PATH
msg "Setting environment variables after installation..."
msg "Installing idris ..."
cabal update
cabal install idris
msg "Idris installed!"
echo 'export PATH=/opt/ghc/7.10.3/bin/:/opt/cabal/2.0/bin/:$HOME/.cabal/bin/:$PATH' >> /home/vagrant/.bashrc
source /home/vagrant/.bashrc
msg "GHC, Cabal and Idris set to environment path ==> $PATH"
}
main() {
idris
liquid_prompt
exit 0
}
main
exit_err "Ouch... LiquidPrompt provision failed!"