| 1 | #!/usr/bin/env bash
 | 
| 2 | #
 | 
| 3 | # Usage:
 | 
| 4 | #   demo/julia.sh <function name>
 | 
| 5 | 
 | 
| 6 | set -o nounset
 | 
| 7 | set -o pipefail
 | 
| 8 | set -o errexit
 | 
| 9 | 
 | 
| 10 | download() {
 | 
| 11 |   # 139 MB
 | 
| 12 |   wget --directory _tmp --no-clobber \
 | 
| 13 |     'https://julialang-s3.julialang.org/bin/linux/x64/1.9/julia-1.9.3-linux-x86_64.tar.gz'
 | 
| 14 | }
 | 
| 15 | 
 | 
| 16 | # TODO: should make a wedge that's lazy
 | 
| 17 | extract() {
 | 
| 18 |   pushd _tmp
 | 
| 19 |   time tar -x -z < julia-*.tar.gz
 | 
| 20 |   popd
 | 
| 21 | }
 | 
| 22 | 
 | 
| 23 | julia() {
 | 
| 24 |   _tmp/julia-*/bin/julia "$@"
 | 
| 25 | }
 | 
| 26 | 
 | 
| 27 | demo() {
 | 
| 28 |   julia -e 'print("hi from Julia\n")'
 | 
| 29 | }
 | 
| 30 | 
 | 
| 31 | "$@"
 |