-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathshapemapper
executable file
·48 lines (39 loc) · 1.57 KB
/
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env bash
#----------------------------------------------------------------------#
# This file is a part of ShapeMapper, and is licensed under the terms #
# of the MIT license. Copyright 2018 Steven Busan. #
#----------------------------------------------------------------------#
# warn if attempting to run on a Mac
if [ "$(uname)" == "Darwin" ]; then
msg="ShapeMapper is only currently built for 64-bit Linux. "
msg+="Mac is unsupported."
echo "$msg"
exit 1
fi
# 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/paths/bin_paths.sh
# warn user if executables are not present
if [ -z $(which shapemapper_read_trimmer) ] || \
[ -z $(which shapemapper_mutation_parser) ] || \
[ -z $(which shapemapper_mutation_counter) ]; then
msg="Error: can't find core shapemapper executables. Download "
msg+="the full release tarball (not just the source code) "
msg+="which includes compiled executables."
echo "$msg"
exit 1
fi
exec python3 ${THIS_DIR}/internals/python/cli.py "$@"