#!/bin/bash -eu # # script/bootstrap # mas # # Installs development dependencies and builds project dependencies. # mas_dir="$(readlink -fn "$(dirname "${BASH_SOURCE:-"${0}"}")/..")" if ! cd -- "${mas_dir}"; then printf $'Error: Could not cd into mas directory: %s\n' "${mas_dir}" >&2 exit 1 fi function usage { echo 'Usage: bootstrap [-f]' >&2 echo ' -f option enables frozen mode' >&2 exit 1 } # Detect presence of `-f` frozen option while getopts 'f' opt; do case "${opt}" in f) frozen='--no-lock --no-upgrade' ;; *) usage ;; esac done printf $'==> 👢 Bootstrapping mas %s\n' "$(script/version)" # shellcheck disable=SC2086 brew bundle install ${frozen} --verbose