diff options
author | Yuqian Yang <crupest@crupest.life> | 2025-02-23 16:40:32 +0800 |
---|---|---|
committer | Yuqian Yang <crupest@crupest.life> | 2025-02-23 16:40:32 +0800 |
commit | 7e54b1ebe280d760347b1b640c9d4d0038ca6c58 (patch) | |
tree | 4d42c7a84066f0c2ae320e32dc7d86072fd0e4ae /services/manage | |
parent | 34704b2090c48d9ab9e7458475fd701a38706ae7 (diff) | |
download | crupest-7e54b1ebe280d760347b1b640c9d4d0038ca6c58.tar.gz crupest-7e54b1ebe280d760347b1b640c9d4d0038ca6c58.tar.bz2 crupest-7e54b1ebe280d760347b1b640c9d4d0038ca6c58.zip |
feat(python): move python codes.
Diffstat (limited to 'services/manage')
-rwxr-xr-x | services/manage | 18 |
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 |