🎉 feat: 在git克隆失败时恢复原有配置
This commit is contained in:
parent
3f24e044be
commit
70e5249c16
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue