diff options
author | Guangxiong Lin <[email protected]> | 2023-11-16 20:33:53 +0800 |
---|---|---|
committer | Guangxiong Lin <[email protected]> | 2023-11-16 20:34:27 +0800 |
commit | 39c8b27c342442e585e0729982bdb82a95bc2e6c (patch) | |
tree | a12beb712a8db867db5de39794deb74cbe538ae9 /.macos | |
parent | 6bed95dcccfc57e4c8db0c0b5fa2eb0739ae2f49 (diff) | |
download | dotfiles-39c8b27c342442e585e0729982bdb82a95bc2e6c.tar.gz dotfiles-39c8b27c342442e585e0729982bdb82a95bc2e6c.tar.bz2 dotfiles-39c8b27c342442e585e0729982bdb82a95bc2e6c.zip |
Refactor
Diffstat (limited to '.macos')
-rw-r--r-- | .macos | 19 |
1 files changed, 7 insertions, 12 deletions
@@ -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)" |