#!/usr/bin/env bash # Welcome to the team 🙌 # # To help you getting started we have prepared an automated seup script for your computer. # Please run the following command to install and configure all necessary softwares and tools. # # curl -o- https://raw.githubusercontent.com/soramitsukhmer/setup/main/install | sh # taps=( 'homebrew/cask-fonts' 'pp-spaces/khmer-unicode' 'soramitsukhmer/tap' ) formulae=( 'gh' 'git' 'htop' 'jq' 'tree' 'watch' 'openfortivpn' 'soramitsukhmer/tap/lockrun' 'soramitsukhmer/tap/sshpass' ) casks=( 'firefox' 'google-chrome' 'visual-studio-code' 'fork' 'iterm2' 'khmer-unicode-layout' 'font-khmeros-bundle' 'font-fira-code' ) # ================================================== # DO NOT MODIFY ANYTHING BELOW # ================================================== if [[ -t 1 ]]; then tty_escape() { printf "\033[%sm" "$1"; } else tty_escape() { :; } fi tty_mkbold() { tty_escape "1;$1"; } tty_underline="$(tty_escape "4;39")" tty_blue="$(tty_mkbold 34)" tty_red="$(tty_mkbold 31)" tty_yellow="$(tty_mkbold 33)" tty_bold="$(tty_mkbold 39)" tty_reset="$(tty_escape 0)" shell_join() { local arg printf "%s" "$1" shift for arg in "$@"; do printf " " printf "%s" "${arg// /\ }" done } chomp() { printf "%s" "${1/"$'\n'"/}" } ohai() { printf "${tty_blue}==>${tty_bold} %s${tty_reset}\n" "$(shell_join "$@")" } warn() { printf "${tty_yellow}Warning${tty_reset}: %s\n" "$(chomp "$1")" } error(){ printf "${tty_red}Error${tty_reset}: %s\n" "$(chomp "$1")" >>/dev/stderr } abort() { printf "%s\n" "$1" exit 1 } execute() { if ! "$@"; then abort "$(printf "Failed during: %s" "$(shell_join "$@")")" fi } # --- echo " ____ _ _ " echo " / ___| ___ _ __ __ _ _ __ ___ (_) |_ ___ _ _ " echo " \___ \ / _ \| '__/ _\` | '_ \` _ \| | __/ __| | | |" echo " ___) | (_) | | | (_| | | | | | | | |_\__ \ |_| |" echo " |____/ \___/|_| \__,_|_| |_| |_|_|\__|___/\__,_|" echo # (optional) move to a new line echo # (optional) move to a new line echo "Welcome to the team 🙌" echo "If it's your first day today, we'd just like you to know how happy we are to have you with us 😃" echo # (optional) move to a new line echo "To help you getting started we have prepared an automated seup script for your computer." echo "Please accept the below question to install and configure all necessary softwares and tools." echo # (optional) move to a new line read -p "Do you want to continue? [y/n]: " -n 1 -r echo # (optional) move to a new line if [[ ! $REPLY =~ ^[Yy]$ ]] then exit 1 fi # # Check if Homebrew is installed # If not found, install it # if [ ! "$(command -v brew)" ]; then ohai "Install Homebrew" curl -o- https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh | bash fi # # Update Brew Repository # execute brew update echo # (optional) move to a new line # # Add Brew Tap repositories # echo # (optional) move to a new line for item in "${taps[@]}"; do ohai "Tapping ${item}..." execute brew tap "${item}" done echo # (optional) move to a new line # # Install Formulae # echo "🧰 Installing CLI Applications..." echo # (optional) move to a new line for item in "${formulae[@]}"; do ohai "Installing ${item} formular..." execute brew install --verbose "${item}" echo # (optional) move to a new line done echo # (optional) move to a new line # # Install Casks # echo "🖼 Installing Applications..." echo # (optional) move to a new line for item in "${casks[@]}"; do ohai "Installing ${item} cask..." execute brew install --verbose --cask "${item}" echo # (optional) move to a new line done echo # (optional) move to a new line # # Brew Cleanup # execute brew cleanup # Done echo # (optional) move to a new line echo "🎉 Installation successful!"