🐛 fix: 日志加颜色,更新文档中的命令格式
This commit is contained in:
parent
da8bfaa008
commit
fd820a40c5
|
@ -46,16 +46,15 @@ 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."
|
||||
# 删除克隆的目录
|
||||
echo "delete the unfinished clone dir: $HOME/.config"
|
||||
echo -e "\033[031mgit clone failed, please check your network.\033[0m"
|
||||
# 删除克隆的目录,恢复原有配置
|
||||
echo -e "\033[034mdelete the unfinished clone dir: $HOME/.config"
|
||||
[ -d "$HOME/.config" ] && rm -rf "$HOME/.config"
|
||||
# 恢复原有配置
|
||||
if test -d /tmp/.config; then
|
||||
echo "restoring the old config to $HOME/.config"
|
||||
echo -e "\033[034mrestoring the old config to $HOME/.config.\033[0m"
|
||||
mv /tmp/.config "$HOME/.config"
|
||||
else
|
||||
echo "no old config found, skip restore config dir."
|
||||
echo -e "\033[032mno old config found, skip restore config dir..\033[0m"
|
||||
fi
|
||||
exit 1
|
||||
}
|
||||
|
@ -67,9 +66,8 @@ cat >"$HOME"/.config/.bin/.Runtime/SELF_MARK_AS_INSTALLED_FROM_SCRIPT <<EOF
|
|||
如果你想要重新安装, 请删除此文件——下次安装时会将当前配置仓库移动到备份目录(默认为~/.local/share/Origin_Config_Backup).
|
||||
EOF
|
||||
|
||||
echo "git clone success, init project by script itself..."
|
||||
|
||||
# = 通过目标仓库的初始化脚本进行初始化
|
||||
if test "$INIT" = "enable"; then
|
||||
echo -e "\033[032mgit clone success, init project by script itself...\033[0m"
|
||||
bash "$HOME"/.config/.bin/bin/Init.sh
|
||||
fi
|
||||
|
|
11
readme.md
11
readme.md
|
@ -9,17 +9,14 @@
|
|||
克隆 dev 分支(`-b`,默认)并进行初始化(`-i`):
|
||||
|
||||
```bash
|
||||
curl -sSL https://gitea.yever.top/Hawkin/setup-kit/raw/main/config-os-and-apps.sh | bash -- -ib dev
|
||||
curl -sSL https://gitea.yever.top/Hawkin/setup-kit/raw/main/config-os-and-apps.sh | bash -s -- -ib dev
|
||||
```
|
||||
|
||||
指定分支(`-b`)但不进行初始化:
|
||||
|
||||
```bash
|
||||
curl -sSL https://gitea.yever.top/Hawkin/setup-kit/raw/main/config-os-and-apps.sh | bash -- -b dev
|
||||
```
|
||||
|
||||
或
|
||||
````bash
|
||||
curl -sSL https://gitea.yever.top/Hawkin/setup-kit/raw/main/config-os-and-apps.sh | bash -s -- -b dev
|
||||
|
||||
```bash
|
||||
wget -qO- https://gitea.yever.top/Hawkin/setup-kit/raw/main/config-os-and-apps.sh | bash
|
||||
```
|
||||
````
|
||||
|
|
Loading…
Reference in New Issue