-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmarple_dev_run
More file actions
executable file
·29 lines (23 loc) · 976 Bytes
/
marple_dev_run
File metadata and controls
executable file
·29 lines (23 loc) · 976 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
#!/bin/bash
# -------------------------------------------------------------
# marple_dev_run - Runs marple for development
# Sep 2018 - Hrutvik Kanabar
# -------------------------------------------------------------
# Resolve symlinks to get true marple dir
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
# if $SOURCE was a relative symlink, we need to resolve it relative to the
# path where the symlink file was located
done
MARPLE_DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null && pwd )"
# Activate virtual environment
source ${MARPLE_DIR}/marple_env/bin/activate
# Set python path
export PYTHONPATH=${MARPLE_DIR}/:${PYTHONPATH}
# Run marple
sudo `which python3` ${MARPLE_DIR}/marple/__main__.py "$@"
# Deactivate virtual environment
deactivate