Last active
June 21, 2022 16:25
-
-
Save johnhpatton/30b828c075e156e1c62654d24874a5dd to your computer and use it in GitHub Desktop.
Install Mac Things
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
TEMPDIR=$(mktemp -d) | |
pushd "${TEMPDIR}" | |
[ ! -d "$HOME/bin" ] && mkdir -p "$HOME/bin" | |
echo "Installing homebrew..." | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
declare -a pkgs=() | |
pkgs+=("bash") | |
pkgs+=("bash-completion") | |
pkgs+=("coreutils") | |
pkgs+=("binutils") | |
pkgs+=("diffutils") | |
pkgs+=("findutils") | |
pkgs+=("gnu-tar") | |
pkgs+=("gnu-sed") | |
pkgs+=("gnu-which") | |
pkgs+=("gnu-indent") | |
pkgs+=("gnutls") | |
pkgs+=("grep") | |
pkgs+=("gzip") | |
pkgs+=("screen") | |
pkgs+=("watch") | |
pkgs+=("wget") | |
pkgs+=("wdiff") | |
pkgs+=("curl") | |
pkgs+=("jq") | |
pkgs+=("git") | |
pkgs+=("readline") | |
pkgs+=("vim") | |
pkgs+=("openssh") | |
pkgs+=("unzip") | |
pkgs+=("python") | |
pkgs+=("netstat") | |
pkgs+=("iproute2mac") | |
pkgs+=("ipcalc") | |
pkgs+=("dos2unix") | |
echo "Installing a bunch of brew packages..." | |
for pkg in "${pkgs[@]}"; do | |
! brew list "${pkg% *}" &>/dev/null && brew install ${pkg} | |
done | |
ARCH=$(uname -m) | |
[ "${ARCH}" == "arm64" ] && HOMEBREW_PREFIX=/opt/homebrew || HOMEBREW_PREFIX=/usr/local | |
echo "Installing some python packages..." | |
python --version | |
python -m pip install azure-cli | |
python -m pip install ansible | |
echo "Installing golang..." | |
curl -sL -o "${TEMPDIR}/go.pkg" "https://go.dev/dl/go1.18.3.darwin-${ARCH}.pkg" | |
sudo installer -pkg "${TEMPDIR}/go.pkg" -target / | |
echo "Installing Terraform Switcher and latest Terraform..." | |
curl -sL -o "${TEMPDIR}/install.sh" "https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh" | |
chmod +x install.sh | |
sudo "${TEMPDIR}/install.sh" | |
/usr/local/bin/tfswitch --bin=$HOME/bin/terraform --latest | |
cat <<EOF >> $HOME/.bashrc | |
export PATH="$HOMEBREW_PREFIX/bin:$HOMEBREW_PREFIX/opt/ruby/bin:$HOMEBREW_PREFIX/opt/python/libexec/bin:$HOMEBREW_PREFIX/opt/gnu-tar/libexec/gnubin:$HOMEBREW_PREFIX/opt/diffutils/bin:$HOMEBREW_PREFIX/opt/coreutils/libexec/gnubin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:$HOME/bin" | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment