diff options
author | Yuqian Yang <crupest@crupest.life> | 2025-06-10 16:34:42 +0800 |
---|---|---|
committer | Yuqian Yang <crupest@crupest.life> | 2025-06-10 16:34:42 +0800 |
commit | 4c207e6433a73ae7c75dc75fca3631e2f02dca95 (patch) | |
tree | ec36daff383438b1a8df2f08c8077d9edfb9ce65 /services/manage | |
parent | b63999fd70ed7878569b969c79820e85621dcc2b (diff) | |
download | crupest-4c207e6433a73ae7c75dc75fca3631e2f02dca95.tar.gz crupest-4c207e6433a73ae7c75dc75fca3631e2f02dca95.tar.bz2 crupest-4c207e6433a73ae7c75dc75fca3631e2f02dca95.zip |
refactor: bye, python!
Diffstat (limited to 'services/manage')
-rwxr-xr-x | services/manage | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/services/manage b/services/manage index 4589475..c81e6dc 100755 --- a/services/manage +++ b/services/manage @@ -2,23 +2,16 @@ set -e -python3 --version >/dev/null 2>&1 || ( - echo Error: failed to run Python with python3 --version. +deno --version >/dev/null 2>&1 || ( + echo "Error: failed to run deno --version." + echo "If deno is not installed, install it with:" + echo " curl -fsSL https://deno.land/install.sh | sh" exit 1 ) -script_dir="$(dirname "$0")" - -# shellcheck disable=SC2046 -export $(xargs <"${script_dir:?}/base-config") - -CRUPEST_PROJECT_DIR="$(realpath "$script_dir/..")" +CRUPEST_PROJECT_DIR="$(realpath "$(dirname "$0")/..")" export CRUPEST_PROJECT_DIR -export PYTHONPATH="$CRUPEST_PROJECT_DIR/python:$PYTHONPATH" +echo "Project Dir: $CRUPEST_PROJECT_DIR" -if [[ "$#" != "0" ]] && [[ "$1" == "gen-tmpl" ]]; then - python3 -m cru.service template generate "${@:2}" -else - python3 -m cru.service "$@" -fi +exec deno run -A "$CRUPEST_PROJECT_DIR/deno/service-manager/main.ts" --project-dir "$CRUPEST_PROJECT_DIR" "$@" |