2022-08-20 01:21:22 +09:00
|
|
|
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
cd -- "$(dirname -- "$0")"
|
|
|
|
|
|
|
|
function install_homebrew_packages() {
|
|
|
|
local uid
|
|
|
|
uid=${SUDO_UID:-$(id -u)}
|
|
|
|
sudo --user="#$uid" \
|
|
|
|
NONINTERACTIVE=1 \
|
|
|
|
bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
|
2023-08-08 21:18:23 +09:00
|
|
|
if [[ -x /usr/local/bin/brew ]]; then
|
|
|
|
sudo --user="#$uid" \
|
|
|
|
/usr/local/bin/brew bundle --global
|
|
|
|
else
|
|
|
|
sudo --user="#$uid" \
|
|
|
|
/home/linuxbrew/.linuxbrew/bin/brew bundle --global
|
|
|
|
fi
|
2022-08-20 01:21:22 +09:00
|
|
|
}
|
|
|
|
|
2023-08-08 21:18:23 +09:00
|
|
|
[[ $(uname -sm) =~ ^(Linux x86_64|Darwin x86_64)$ ]] &&
|
|
|
|
install_homebrew_packages
|