-
Notifications
You must be signed in to change notification settings - Fork 0
/
clean.sh
55 lines (46 loc) · 1.07 KB
/
clean.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
52
53
54
55
#!/usr/bin/env bash
case `uname` in
Linux) ECHO="echo -e" ;;
*) ECHO="echo" ;;
esac
usage(){
EXIT=$1
$ECHO "clean.sh [options]"
$ECHO
$ECHO "Options:"
$ECHO "-d \tuse the developer branch of Coffea (default = 0)"
$ECHO "-h \tprint this message and exit"
$ECHO "-n [NAME] \toverride the name of the virtual environment (default = coffeaenv)"
exit $EXIT
}
NAME=coffeaenv
DEV=0
# check arguments
while getopts "dhn:" opt; do
case "$opt" in
d) DEV=1
;;
h) usage 0
;;
n) NAME=$OPTARG
;;
:) printf "missing argument for -%s\n" "$OPTARG" >&2
usage -1
;;
\?) printf "illegal option: -%s\n" "$OPTARG" >&2
usage -2
;;
esac
done
$ECHO "Removing the virtual environment ... "
rm -rf ${NAME} ${NAME}.tar.gz
if [[ "$DEV" == "1" ]]; then
$ECHO "\nRemoving the 'development' version of Coffea ... "
rm -rf coffea
fi
$ECHO "\nRemoving the ipython/jupyter kernel ... "
storage_dir=$(readlink -f $PWD)
rm -rf ${storage_dir}/.local/share/jupyter/kernels/${NAME}
$ECHO "\nRemoving lpc_dask"
rm -rf lpc_dask
$ECHO "\nFINISHED"