aboutsummaryrefslogtreecommitdiff
path: root/services/manage
diff options
context:
space:
mode:
Diffstat (limited to 'services/manage')
-rwxr-xr-xservices/manage18
1 files changed, 14 insertions, 4 deletions
diff --git a/services/manage b/services/manage
index 01f3145..4589475 100755
--- a/services/manage
+++ b/services/manage
@@ -2,13 +2,23 @@
set -e
-python3 --version > /dev/null 2>&1 || (
+python3 --version >/dev/null 2>&1 || (
echo Error: failed to run Python with python3 --version.
exit 1
)
script_dir="$(dirname "$0")"
-. "$script_dir/common.bash"
-export PYTHONPATH="$CRUPEST_PROJECT_DIR/$CRUPEST_SERVICES_DIR:$PYTHONPATH"
-python3 -m manager.service "$@"
+# shellcheck disable=SC2046
+export $(xargs <"${script_dir:?}/base-config")
+
+CRUPEST_PROJECT_DIR="$(realpath "$script_dir/..")"
+export CRUPEST_PROJECT_DIR
+
+export PYTHONPATH="$CRUPEST_PROJECT_DIR/python:$PYTHONPATH"
+
+if [[ "$#" != "0" ]] && [[ "$1" == "gen-tmpl" ]]; then
+ python3 -m cru.service template generate "${@:2}"
+else
+ python3 -m cru.service "$@"
+fi