forked from GaloisInc/ICryptol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathicryptol
executable file
·37 lines (29 loc) · 1.08 KB
/
icryptol
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
#!/bin/bash
# icryptol
# Author: acfoltzer@galois.com
# Copyright Galois, Inc. 2015
# Driver script for the icryptol notebook interface. This is a thin
# wrapper around the ipython command line interface, and will in fact
# forward along any arguments to the invocation of `ipython notebook`.
#
# This script attempts to be location-agnostic but currently assumes a
# POSIX layout for the installation of the icryptol-kernel executable
# and the profile.tar that contains the basic cryptol profile for
# IPython. By setting the IPYTHONDIR environment variable, you can
# control where this profile is created (if not set it will be in
# $HOME/.ipython).
IPYTHONDIR=${IPYTHONDIR:-$HOME/.ipython}
set -e
command -v ipython >/dev/null 2>&1 || {
echo >&2 "Error: ipython not found in \$PATH"
exit 1
}
command -v icryptol-kernel >/dev/null 2>&1 || {
echo >&2 "Error: icryptol-kernel not found in \$PATH"
exit 1
}
ipython kernelspec list | grep cryptol 2>&1 || {
tar -C $IPYTHONDIR \
-xf $(dirname $(which icryptol-kernel))/../share/ICryptol/profile.tar
}
ipython notebook $@