From b7eaa5e4994230d9cbe1ea0a2f4bf0e3637f75b6 Mon Sep 17 00:00:00 2001 From: HawkinC Macbook Date: Thu, 17 Apr 2025 18:14:51 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=89=20feat:=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E4=B8=80=E9=94=AE=E5=90=AF=E5=8A=A8=E8=84=9A=E6=9C=AC=EF=BC=8C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AE=89=E8=A3=85=E6=A0=87=E8=AE=B0=E4=BB=A5?= =?UTF-8?q?=E9=81=BF=E5=85=8D=E9=87=8D=E5=A4=8D=E5=AE=89=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config-os-and-apps.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/config-os-and-apps.sh b/config-os-and-apps.sh index 3a29992..542b574 100644 --- a/config-os-and-apps.sh +++ b/config-os-and-apps.sh @@ -24,20 +24,28 @@ while getopts ":hb:" opt; do done # = clone 到 tmp/.config 并加载profile入口 -test -f "$HOME/.config/.bin/.Runtime/local.env.ini" && { +# == 如果已安装过,则不再执行 +test -f "$HOME"/.config/.bin/.Runtime/SELF_MARK_AS_INSTALLED_FROM_SCRIPT && { echo "local.env.ini already exists, end the install. please remove it first if need re-install." exit 1 } -# = 移动原有配置 +# == 移走原有配置目录 [ -d "/tmp/.config" ] && rm -rf /tmp/.config # 如果存在, 删除 /tmp/.config [ -d "$HOME/.config" ] && mv "$HOME/.config" /tmp/.config # 移动原有 $HOME/.config 配置到 /tmp/.config - +# 克隆,如果失败则退出 git clone --depth 1 --branch "$BRANCH" --single-branch https://gitea.yever.top/Hawkin/.config.git "$HOME"/.config test $? -ne 0 && { echo "git clone failed, please check your network." exit 1 } +# = 标记已安装 +test -d "$HOME"/.config/.bin/.Runtime || mkdir -p "$HOME"/.config/.bin/.Runtime +cat >"$HOME"/.config/.bin/.Runtime/SELF_MARK_AS_INSTALLED_FROM_SCRIPT <