mirror of
https://gitee.com/ineo6/homebrew-install.git
synced 2025-05-29 19:09:16 +08:00
feat: 更新脚本
This commit is contained in:
parent
f2f8e25fc9
commit
86caf05516
40
install.sh
40
install.sh
@ -39,6 +39,28 @@ then
|
|||||||
abort 'Bash must not run in POSIX mode. Please unset POSIXLY_CORRECT and try again.'
|
abort 'Bash must not run in POSIX mode. Please unset POSIXLY_CORRECT and try again.'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
cat <<EOS
|
||||||
|
Homebrew Installer
|
||||||
|
Usage: [NONINTERACTIVE=1] [CI=1] install.sh [options]
|
||||||
|
-h, --help 显示帮助信息.
|
||||||
|
NONINTERACTIVE 安装时不需要用户确认输入
|
||||||
|
CI CI模式安装
|
||||||
|
EOS
|
||||||
|
exit "${1:-0}"
|
||||||
|
}
|
||||||
|
|
||||||
|
while [[ $# -gt 0 ]]
|
||||||
|
do
|
||||||
|
case "$1" in
|
||||||
|
-h | --help) usage ;;
|
||||||
|
*)
|
||||||
|
warn "Unrecognized option: '$1'"
|
||||||
|
usage 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
# string formatters
|
# string formatters
|
||||||
if [[ -t 1 ]]
|
if [[ -t 1 ]]
|
||||||
then
|
then
|
||||||
@ -73,14 +95,14 @@ ohai() {
|
|||||||
printf "${tty_blue}==>${tty_bold} %s${tty_reset}\n" "$(shell_join "$@")"
|
printf "${tty_blue}==>${tty_bold} %s${tty_reset}\n" "$(shell_join "$@")"
|
||||||
}
|
}
|
||||||
|
|
||||||
highlight() {
|
|
||||||
printf "${tty_green} %s${tty_reset}\n" "$(shell_join "$@")"
|
|
||||||
}
|
|
||||||
|
|
||||||
warn() {
|
warn() {
|
||||||
printf "${tty_red}Warning${tty_reset}: %s\n" "$(chomp "$1")" >&2
|
printf "${tty_red}Warning${tty_reset}: %s\n" "$(chomp "$1")" >&2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
highlight() {
|
||||||
|
printf "${tty_green} %s${tty_reset}\n" "$(shell_join "$@")"
|
||||||
|
}
|
||||||
|
|
||||||
checkExecute() {
|
checkExecute() {
|
||||||
if [ $? -ne 0 ];then
|
if [ $? -ne 0 ];then
|
||||||
echo "${tty_red}执行成功 '$1'${tty_reset}"
|
echo "${tty_red}执行成功 '$1'${tty_reset}"
|
||||||
@ -589,13 +611,21 @@ EOABORT
|
|||||||
|
|
||||||
echo "$(
|
echo "$(
|
||||||
cat <<EOS
|
cat <<EOS
|
||||||
系统版本太旧,可能会遇到一些未知问题
|
因为系统版本,可能会遇到一些未知问题
|
||||||
EOS
|
EOS
|
||||||
)
|
)
|
||||||
" | tr -d "\\"
|
" | tr -d "\\"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
ohai "脚本会安装以下内容:"
|
||||||
|
echo "${HOMEBREW_PREFIX}/bin/brew"
|
||||||
|
echo "${HOMEBREW_PREFIX}/share/doc/homebrew"
|
||||||
|
echo "${HOMEBREW_PREFIX}/share/man/man1/brew.1"
|
||||||
|
echo "${HOMEBREW_PREFIX}/share/zsh/site-functions/_brew"
|
||||||
|
echo "${HOMEBREW_PREFIX}/etc/bash_completion.d/brew"
|
||||||
|
echo "${HOMEBREW_REPOSITORY}"
|
||||||
|
|
||||||
# Keep relatively in sync with
|
# Keep relatively in sync with
|
||||||
# https://github.com/Homebrew/brew/blob/master/Library/Homebrew/keg.rb
|
# https://github.com/Homebrew/brew/blob/master/Library/Homebrew/keg.rb
|
||||||
directories=(
|
directories=(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user