🎉 feat: 在git克隆失败时恢复原有配置

This commit is contained in:
HawkinC Macbook 2025-04-17 19:21:57 +08:00
parent 3f24e044be
commit 70e5249c16
1 changed files with 4 additions and 0 deletions

View File

@ -36,6 +36,10 @@ test -f "$HOME"/.config/.bin/.Runtime/SELF_MARK_AS_INSTALLED_FROM_SCRIPT && {
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."
# 恢复原有配置
[ -d "$HOME/.config" ] && rm -rf "$HOME/.config"
mv /tmp/.config "$HOME/.config"
echo "restored the old config to $HOME/.config"
exit 1
}