From fa4c0e5a9e17788bc7a270cf1f3d5a5cf40506cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=9F=E5=85=89-k?= <36470587+kxgx@users.noreply.github.com> Date: Tue, 14 Jan 2025 06:57:24 +0800 Subject: [PATCH] Update install.sh --- bin/install.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bin/install.sh b/bin/install.sh index f079a85..f3e6f39 100644 --- a/bin/install.sh +++ b/bin/install.sh @@ -37,6 +37,14 @@ while [ "$#" -gt 0 ]; do --pisugar-power-manager) USE_PISUGAR_POWER_MANAGER=true ;; + --version) + if [ -z "$2" ]; then + echo "错误: --version 参数后需要跟版本号" + exit 1 + fi + VERSION="$2" # 将版本号赋值给变量 VERSION + shift 2 # 移动参数,跳过版本号参数及其值 + ;; --debug) DEBUG=true ;; @@ -225,7 +233,7 @@ setup_service() { if [ ! -d "$HOME/2.13-Ink-screen-clock" ]; then echo "正在克隆仓库" cd ~ - if ! git clone $INK_SCREEN_CLOCK_REPO_URL; then + if ! git clone -b $VERSION $INK_SCREEN_CLOCK_REPO_URL; then echo "克隆仓库失败" >&2 exit 1 fi