mirror of
https://gitee.com/ineo6/homebrew-install.git
synced 2025-04-06 03:58:05 +08:00
feat: 更新脚本
This commit is contained in:
parent
ed40e3a56f
commit
e5283f438e
@ -269,7 +269,7 @@ test_ruby() {
|
|||||||
no_usable_ruby() {
|
no_usable_ruby() {
|
||||||
local ruby_exec
|
local ruby_exec
|
||||||
IFS=$'\n' # Do word splitting on new lines only
|
IFS=$'\n' # Do word splitting on new lines only
|
||||||
for ruby_exec in $(which -a ruby); do
|
for ruby_exec in $(which -a ruby 2>/dev/null); do
|
||||||
if test_ruby "$ruby_exec"; then
|
if test_ruby "$ruby_exec"; then
|
||||||
IFS=$' \t\n' # Restore IFS to its default value
|
IFS=$' \t\n' # Restore IFS to its default value
|
||||||
return 1
|
return 1
|
||||||
@ -360,8 +360,14 @@ fi
|
|||||||
HOMEBREW_CORE="${HOMEBREW_REPOSITORY}/Library/Taps/homebrew/homebrew-core"
|
HOMEBREW_CORE="${HOMEBREW_REPOSITORY}/Library/Taps/homebrew/homebrew-core"
|
||||||
|
|
||||||
if [[ "${EUID:-${UID}}" == "0" ]]; then
|
if [[ "${EUID:-${UID}}" == "0" ]]; then
|
||||||
abort "Don't run this as root!"
|
# Allow Azure Pipelines/GitHub Actions/Docker/Concourse/Kubernetes to do everything as root (as it's normal there)
|
||||||
elif [[ -d "${HOMEBREW_PREFIX}" && ! -x "${HOMEBREW_PREFIX}" ]]; then
|
if ! [[ -f /proc/1/cgroup ]] ||
|
||||||
|
! grep -E "azpl_job|actions_job|docker|garden|kubepods" -q /proc/1/cgroup; then
|
||||||
|
abort "Don't run this as root!"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -d "${HOMEBREW_PREFIX}" && ! -x "${HOMEBREW_PREFIX}" ]]; then
|
||||||
abort "$(cat <<EOABORT
|
abort "$(cat <<EOABORT
|
||||||
The Homebrew prefix, ${HOMEBREW_PREFIX}, exists but is not searchable.
|
The Homebrew prefix, ${HOMEBREW_PREFIX}, exists but is not searchable.
|
||||||
If this is not intentional, please restore the default permissions and
|
If this is not intentional, please restore the default permissions and
|
||||||
|
12
install.sh
12
install.sh
@ -275,7 +275,7 @@ test_ruby() {
|
|||||||
no_usable_ruby() {
|
no_usable_ruby() {
|
||||||
local ruby_exec
|
local ruby_exec
|
||||||
IFS=$'\n' # Do word splitting on new lines only
|
IFS=$'\n' # Do word splitting on new lines only
|
||||||
for ruby_exec in $(which -a ruby); do
|
for ruby_exec in $(which -a ruby 2>/dev/null); do
|
||||||
if test_ruby "$ruby_exec"; then
|
if test_ruby "$ruby_exec"; then
|
||||||
IFS=$' \t\n' # Restore IFS to its default value
|
IFS=$' \t\n' # Restore IFS to its default value
|
||||||
return 1
|
return 1
|
||||||
@ -366,8 +366,14 @@ fi
|
|||||||
HOMEBREW_CORE="${HOMEBREW_REPOSITORY}/Library/Taps/homebrew/homebrew-core"
|
HOMEBREW_CORE="${HOMEBREW_REPOSITORY}/Library/Taps/homebrew/homebrew-core"
|
||||||
|
|
||||||
if [[ "${EUID:-${UID}}" == "0" ]]; then
|
if [[ "${EUID:-${UID}}" == "0" ]]; then
|
||||||
abort "Don't run this as root!"
|
# Allow Azure Pipelines/GitHub Actions/Docker/Concourse/Kubernetes to do everything as root (as it's normal there)
|
||||||
elif [[ -d "${HOMEBREW_PREFIX}" && ! -x "${HOMEBREW_PREFIX}" ]]; then
|
if ! [[ -f /proc/1/cgroup ]] ||
|
||||||
|
! grep -E "azpl_job|actions_job|docker|garden|kubepods" -q /proc/1/cgroup; then
|
||||||
|
abort "Don't run this as root!"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -d "${HOMEBREW_PREFIX}" && ! -x "${HOMEBREW_PREFIX}" ]]; then
|
||||||
abort "$(cat <<EOABORT
|
abort "$(cat <<EOABORT
|
||||||
The Homebrew prefix, ${HOMEBREW_PREFIX}, exists but is not searchable.
|
The Homebrew prefix, ${HOMEBREW_PREFIX}, exists but is not searchable.
|
||||||
If this is not intentional, please restore the default permissions and
|
If this is not intentional, please restore the default permissions and
|
||||||
|
@ -227,7 +227,7 @@ fi
|
|||||||
if [[ -s $HOMEBREW_REPOSITORY/.gitignore ]]; then
|
if [[ -s $HOMEBREW_REPOSITORY/.gitignore ]]; then
|
||||||
gitignore=$(<"$HOMEBREW_REPOSITORY/.gitignore")
|
gitignore=$(<"$HOMEBREW_REPOSITORY/.gitignore")
|
||||||
else
|
else
|
||||||
gitignore=$(curl -fsSL https://raw.githubusercontent.com/Homebrew/brew/master/.gitignore)
|
gitignore=$(curl -fsSL https://cdn.jsdelivr.net/gh/Homebrew/brew/.gitignore)
|
||||||
fi
|
fi
|
||||||
[[ -n $gitignore ]] || abort "Failed to fetch Homebrew .gitignore!"
|
[[ -n $gitignore ]] || abort "Failed to fetch Homebrew .gitignore!"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user