You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
iTi-System/scripts/iti-system.sh

54 lines
969 B
Bash

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#!/usr/bin/env sh
set -eu
ROOT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
cd "$ROOT_DIR"
PROJECT_VENV="$ROOT_DIR/.venv"
case "${VIRTUAL_ENV:-}" in
""|"$PROJECT_VENV"|"$PROJECT_VENV/")
;;
*)
unset VIRTUAL_ENV
;;
esac
show_help() {
cat <<'EOF'
iTi-System 开发脚本
用法:
./scripts/iti-system.sh <命令> [参数]
常用命令:
help 显示帮助
install 安装开发依赖uv sync --extra dev
test 运行测试uv run pytest -q
release [版本] 发布系统包:测试、改版本、提交、打 tag、推送
EOF
}
command=${1:-help}
shift || true
case "$command" in
help|-h|--help)
show_help
;;
install)
uv sync --extra dev
;;
test)
uv run pytest -q
;;
release)
sh scripts/release.sh "$@"
;;
*)
echo "未知命令:$command" >&2
echo >&2
show_help >&2
exit 2
;;
esac