From 39c8b27c342442e585e0729982bdb82a95bc2e6c Mon Sep 17 00:00:00 2001 From: Guangxiong Lin Date: Thu, 16 Nov 2023 20:33:53 +0800 Subject: Refactor --- .macos | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to '.macos') diff --git a/.macos b/.macos index f154236..f28342f 100644 --- a/.macos +++ b/.macos @@ -1,23 +1,18 @@ #!/usr/bin/env bash -macos_update_path () { - new_path=$1 - [ -d $new_path ] && export PATH=$new_path:$PATH -} +[ $(uname) = Darwin ] || return -macos_update_path /usr/local/opt/openjdk/bin -macos_update_path /usr/local/opt/ruby/bin -macos_update_path /usr/local/opt/llvm/bin +export IS_MACOS=1 export BROWSER='open' - alias bug='brew upgrade --greedy' -if [[ $(spctl --status) == 'assessments enabled' ]]; then - echo 'Software installment is limited again. Password is required to remove the limit.' +[ "$(spctl --status)" = 'assessments enabled' ] && + echo 'Software installment is limited again. Password is required to remove the limit.' && sudo spctl --master-disable -fi -[[ $(arch) = "arm64" ]] && +[ $(arch) = 'arm64' ] && + [ -x /opt/homebrew/bin/brew ] && eval "$(/opt/homebrew/bin/brew shellenv)" || + [ -x /usr/local/Homebrew/bin/brew ] && eval "$(/usr/local/Homebrew/bin/brew shellenv)" -- cgit v1.2.3