forked from Weeks-UNC/shapemapper2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
shapemapper
executable file
·29 lines (22 loc) · 991 Bytes
/
shapemapper
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
#!/bin/bash
#----------------------------------------------------------------------#
# This file is a part of ShapeMapper, and is licensed under the terms #
# of the MIT license. Copyright 2018 Steven Busan. #
#----------------------------------------------------------------------#
# Find the parent folder of this script,
# resolving (possibly nested) symlinks
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do
THIS_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$THIS_DIR/$SOURCE"
done
THIS_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
# Locating the parent directory doesn't work in all contexts
# (e.g. inside a Docker container AFAICT) so look at an
# environment var in those cases
if [ ! -z "${SHAPEMAPPER_ROOT_DIR}" ]; then
THIS_DIR="${SHAPEMAPPER_ROOT_DIR}"
fi
source ${THIS_DIR}/internals/install/bin_paths.sh
exec python3 ${THIS_DIR}/internals/python/cli.py "$@"