diff --git a/install.sh b/install.sh index c18b5bb7e41ed0be544ec9cd7291bef4915020c7..fdc2c7480691d0a0a5eb1dbc0d4b9e4849889a39 100644 --- a/install.sh +++ b/install.sh @@ -1,6 +1,7 @@ #!/bin/bash +clear set -u - +echo 请输入开机密码因为需要读写权限 # First check if the OS is Linux. if [[ "$(uname)" = "Linux" ]]; then HOMEBREW_ON_LINUX=1 @@ -76,7 +77,7 @@ have_sudo_access() { fi if [[ -z "${HOMEBREW_ON_LINUX-}" ]] && [[ "$HAVE_SUDO_ACCESS" -ne 0 ]]; then - abort "Need sudo access on macOS (e.g. the user $USER to be an Administrator)!" + abort "在 macOS 上需要root(sudo)权限 (比如 将用户权限 $USER 提升为管理员权限)!" fi return "$HAVE_SUDO_ACCESS" @@ -140,7 +141,7 @@ getc() { wait_for_user() { local c echo - echo "Press RETURN to continue or any other key to abort" + echo "请通过按“ENTER”键进入下一个安装部分" getc c # we test for \r and \n because some stuff does \r instead if ! [[ "$c" == $'\r' || "$c" == $'\n' ]]; then @@ -252,12 +253,11 @@ outdated_glibc() { if [[ -n "${HOMEBREW_ON_LINUX-}" ]] && no_usable_ruby && outdated_glibc then abort "$(cat <<-EOFABORT - Homebrew requires Ruby $REQUIRED_RUBY_VERSION which was not found on your system. - Homebrew portable Ruby requires Glibc version $REQUIRED_GLIBC_VERSION or newer, - and your Glibc version is too old. - See ${tty_underline}https://docs.brew.sh/Homebrew-on-Linux#requirements${tty_reset} - Install Ruby $REQUIRED_RUBY_VERSION and add its location to your PATH. - EOFABORT + Homebrew 需要有 Ruby $REQUIRED_RUBY_VERSION 语言但在你的系统中找不到. + Homebrew 的便携版 Ruby 需要 Glibc $REQUIRED_GLIBC_VERSION 或其更新版. + 请看 ${tty_underline}https://docs.brew.sh/Homebrew-on-Linux 的requirements(要求)部分${tty_reset} + 安装 Ruby $REQUIRED_RUBY_VERSION 然后添加你的PATH路径. + EOFABORT )" fi @@ -279,7 +279,7 @@ cd "/usr" || exit 1 ####################################################################### script if should_install_git; then abort "$(cat <&1) != *"mkdir"* ]]; then - ohai "Select the Homebrew installation directory" - echo "- ${tty_bold}Enter your password${tty_reset} to install to ${tty_underline}${HOMEBREW_PREFIX_DEFAULT}${tty_reset} (${tty_bold}recommended${tty_reset})" - echo "- ${tty_bold}Press Control-D${tty_reset} to install to ${tty_underline}$HOME/.linuxbrew${tty_reset}" - echo "- ${tty_bold}Press Control-C${tty_reset} to cancel installation" + ohai "选定Homebrew安装目录" + echo "- ${tty_bold}输入密码并回车${tty_reset} 去安装 去 ${tty_underline}${HOMEBREW_PREFIX_DEFAULT}${tty_reset} (${tty_bold}推荐${tty_reset})" + echo "- ${tty_bold}同时按Control和D${tty_reset} 去安装 到 ${tty_underline}$HOME/.linuxbrew${tty_reset}" + echo "- ${tty_bold}同时按 Control和C${tty_reset} 来停止安装" fi if have_sudo_access; then HOMEBREW_PREFIX="$HOMEBREW_PREFIX_DEFAULT" @@ -320,9 +320,8 @@ if [[ "$UID" == "0" ]]; then abort "Don't run this as root!" elif [[ -d "$HOMEBREW_PREFIX" && ! -x "$HOMEBREW_PREFIX" ]]; then abort "$(cat </dev/null || return @@ -585,7 +582,7 @@ if [[ ":${PATH}:" != *":${HOMEBREW_PREFIX}/bin:"* ]]; then warn "${HOMEBREW_PREFIX}/bin is not in your PATH." fi -ohai "Installation successful!" +ohai "安装完成!" echo # Use the shell's audible bell. @@ -594,16 +591,16 @@ if [[ -t 1 ]]; then fi # Use an extra newline and bold to avoid this being missed. -ohai "Homebrew has enabled anonymous aggregate formulae and cask analytics." +ohai "Homebrew是一个匿名者聚集一起分析的组织." echo "$(cat <