Skip to content
This repository
Newer
Older
100755 50 lines (37 sloc) 0.97 kb
165cb776 »
2011-12-24 Add an extra-simple installation wrapper, based on perlbrew's
1 #!/bin/sh
2
3 # Derived from perlbrew-install
4
5 OCAMLBREWURL=https://raw.github.com/hcarty/ocamlbrew/master/ocamlbrew
6 : ${OCAMLBREW_BASE=$HOME/ocamlbrew}
7
d961e079 »
2012-01-02 Add ability to pass custom flags to net installs
8 # Default command line flags
9 : ${OCAMLBREW_FLAGS="-a"}
10
165cb776 »
2011-12-24 Add an extra-simple installation wrapper, based on perlbrew's
11 if [ -z "$TMPDIR" ]; then
12 if [ -d "/tmp" ]; then
13 TMPDIR="/tmp"
14 else
15 TMPDIR="."
16 fi
17 fi
18
19 cd $TMPDIR || exit 1
20
21 LOCALINSTALLER="ocamlbrew-$$"
22
23 echo
24 if type curl >/dev/null 2>&1; then
25 OCAMLBREWDOWNLOAD="curl -k -f -sS -Lo $LOCALINSTALLER $OCAMLBREWURL"
26 elif type wget >/dev/null 2>&1; then
27 OCAMLBREWDOWNLOAD="wget --no-check-certificate -nv -O $LOCALINSTALLER $OCAMLBREWURL"
28 else
29 echo "Need wget or curl to use $0"
30 exit 1
31 fi
32
33 clean_exit () {
34 [ -f $LOCALINSTALLER ] && rm $LOCALINSTALLER
35 exit $1
36 }
37
38 echo "## Download the latest ocamlbrew"
39 $OCAMLBREWDOWNLOAD || clean_exit 1
40
41 echo
42 echo "## Starting ocamlbrew"
43 chmod +x $LOCALINSTALLER
d961e079 »
2012-01-02 Add ability to pass custom flags to net installs
44 ./$LOCALINSTALLER $OCAMLBREW_FLAGS || clean_exit 1
165cb776 »
2011-12-24 Add an extra-simple installation wrapper, based on perlbrew's
45
46 echo
47 echo "## Done."
48 rm ./$LOCALINSTALLER
49
Something went wrong with that request. Please try again.