From d4e0cb395bfc19c68f362ba246906b79037ea9c6 Mon Sep 17 00:00:00 2001 From: SuperManito <68613938+SuperManito@users.noreply.github.com> Date: Fri, 19 Jan 2024 02:01:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=AD=A3=E5=8D=87=E7=BA=A7=E8=BD=AF?= =?UTF-8?q?=E4=BB=B6=E5=8C=85=E5=91=BD=E4=BB=A4=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ChangeMirrors.sh | 22 +++++++++++----------- docs/use/command-options.md | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/ChangeMirrors.sh b/ChangeMirrors.sh index 6ea5a20..dcc055b 100755 --- a/ChangeMirrors.sh +++ b/ChangeMirrors.sh @@ -1,6 +1,6 @@ #!/bin/bash ## Author: SuperManito -## Modified: 2024-01-18 +## Modified: 2024-01-19 ## License: MIT ## GitHub: https://github.com/SuperManito/LinuxMirrors ## Website: https://linuxmirrors.cn @@ -1002,8 +1002,8 @@ function ChangeMirrors() { fi } -## 更新软件包 -function UpdateSoftware() { +## 升级软件包 +function UpgradeSoftware() { function CleanCache() { ## 跳过特殊系统 case "${SYSTEM_JUDGMENT}" in @@ -1052,8 +1052,8 @@ function UpdateSoftware() { ;; esac ## 交互确认 - if [[ -z "${UPDATA_SOFTWARE}" ]]; then - UPDATA_SOFTWARE="false" + if [[ -z "${UPGRADE_SOFTWARE}" ]]; then + UPGRADE_SOFTWARE="false" local CHOICE CHOICE=$(echo -e "\n${BOLD}└─ 是否跳过更新软件包? [Y/n] ${PLAIN}") read -rp "${CHOICE}" INPUT @@ -1061,14 +1061,14 @@ function UpdateSoftware() { case "${INPUT}" in [Yy] | [Yy][Ee][Ss]) ;; [Nn] | [Nn][Oo]) - UPDATA_SOFTWARE="true" + UPGRADE_SOFTWARE="true" ;; *) echo -e "\n$WARN 输入错误,默认不更新!" ;; esac fi - if [[ "${UPDATA_SOFTWARE}" == "false" ]]; then + if [[ "${UPGRADE_SOFTWARE}" == "false" ]]; then return fi echo -e '' @@ -4963,7 +4963,7 @@ function CommandOptions() { --close-firewall 关闭防火墙 true 或 false --backup 备份原有软件源 true 或 false --ignore-backup-tips 忽略覆盖备份提示 无 - --updata-software 更新软件包 true 或 false + --upgrade-software 更新软件包 true 或 false --clean-cache 清理下载缓存 true 或 false --print-diff 打印源文件修改前后差异 无 @@ -5149,11 +5149,11 @@ function CommandOptions() { IGNORE_BACKUP_TIPS="true" ;; ## 更新软件包 - --updata-software) + --upgrade-software | --updata-software) if [ "$2" ]; then case "$2" in [Tt]rue | [Ff]alse) - UPDATA_SOFTWARE="${2,,}" + UPGRADE_SOFTWARE="${2,,}" shift ;; *) @@ -5216,7 +5216,7 @@ function Combin_Function() { BackupOriginalMirrors RemoveOriginMirrors ChangeMirrors - UpdateSoftware + UpgradeSoftware RunEnd } diff --git a/docs/use/command-options.md b/docs/use/command-options.md index 303ca09..b25eb96 100644 --- a/docs/use/command-options.md +++ b/docs/use/command-options.md @@ -17,7 +17,7 @@ | `--close-firewall` | 关闭防火墙 | `true` 或 `false` | | `--backup` | 备份原有软件源 | `true` 或 `false` | | `--ignore-backup-tips` | 忽略覆盖备份提示(即不覆盖备份) | 无 | -| `--updata-software` | 更新软件包 | `true` 或 `false` | +| `--upgrade-software` | 更新软件包 | `true` 或 `false` | | `--clean-cache` | 清理下载缓存 | `true` 或 `false` | | `--print-diff` | 打印源文件修改前后差异 | `true` 或 `false` | | `--help` | 查看帮助菜单 | 无 | @@ -160,7 +160,7 @@ bash <(curl -sSL https://linuxmirrors.cn/main.sh) \ --install-epel true \ --close-firewall true \ --backup true \ - --updata-software false \ + --upgrade-software false \ --clean-cache false \ --ignore-backup-tips ```