-
Notifications
You must be signed in to change notification settings - Fork 1
/
crypt
executable file
·42 lines (38 loc) · 1.28 KB
/
crypt
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
#####################################
# #
# Encryptron: The Discreet Enigma #
# #
#####################################
#
# Ver: 1.0.0-a.1
# Author: npvq
# 2021-08-23
#
# Shell script that sets up environment to run Python.
# https://stackoverflow.com/a/246128/14387133
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 2>&1 && 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
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
# echo "$DIR" # Debug
# Allows importing local modules.
if [ -z ${PYTHONPATH+x} ]; then
export PYTHONPATH="$DIR"
else
export PYTHONPATH="${PYTHONPATH}:${DIR}"
fi
# echo "$PYTHONPATH"
# Run the python script (For troubleshooting Terminal)
# if [ "$1" == "terminal" ]; then
# /usr/bin/env python3 -i "$DIR/encryptron/terminal.py" "${@:2}" &
# export ENCTERM_ID="$! "
# alias resume='fg ${ENCTERM_ID}'
# fg "$ENCTERM_ID"
# # bruh
# else
/usr/bin/env python3 "$DIR/main.py" "$@"
# fi