-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCLI.sh
More file actions
28 lines (26 loc) · 866 Bytes
/
CLI.sh
File metadata and controls
28 lines (26 loc) · 866 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
######################################################################
# MCENV CLI
######################################################################
# Provides a simple set of functions to make it easier to use
# supports bootstrapping to make it possible just have the one
# image, since we don't expect to update it particularly often
export PYTHONPATH=/home/packages:$PYTHONPATH
if [[ "$1" == "get_env" ]]; then
echo "$(cat /home/McEnv/env.sh)"
elif [[ "$1" == "--exec" ]]; then
shift 1;
cmd="$1"
shift 1;
$cmd $@
elif [[ "$1" == "--sh" ]]; then
shift 1;
/bin/bash $@
elif [[ "$1" == "--memprof" ]]; then
mprof_file="$2";
shift 2;
echo "Saving memory profile image to $mprof_file";
mprof run python3 -u "/home/McEnv/CLI.py" $@
mprof plot -o mprof_file
else
python3 -u "/home/McEnv/CLI.py" $@
fi