-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·42 lines (33 loc) · 935 Bytes
/
install.sh
File metadata and controls
executable file
·42 lines (33 loc) · 935 Bytes
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
#!/bin/bash
set -e
if [ -z $1 ] ; then
echo "Please specifiy an installation directory."
exit 1
fi
set -u
KERNEL_DIR=$1
if [ ! -e $KERNEL_DIR ] ; then
read -p "The directory $KERNEL_DIR does not exist. Woud you like to create it? [Y/n] " response
if [ "$response" = "n" ] || [ "$response" = "N" ] ; then
echo "Aborting."
exit 1
fi
mkdir -p $KERNEL_DIR
fi
# The name of the distribution directory to create.
NAME=jupyter-groovy-kernel
VERSION=`cat VERSION`
JAR=$NAME-$VERSION.jar
DIST=target/groovy
if [ ! -e $DIST ] ; then
mkdir -p $DIST
fi
cp target/$JAR $KERNEL_DIR
cat src/distribution/kernel.json | sed "s|__PATH__|$KERNEL_DIR/$JAR|" > $DIST/kernel.json
echo "Installing the Groovy kernel to $KERNEL_DIR"
if [ $(whoami) = root ]; then
jupyter kernelspec install --replace --name groovy $DIST
else
jupyter kernelspec install --replace --user --name groovy $DIST
fi
echo "Done."