#!/usr/bin/env bash if ! command -v zx > /dev/null; then if command -v volta > /dev/null; then logg 'Installing `zx` via `volta`' volta install zx else if command -v brew > /dev/null; then if ! command -v volta > /dev/null; then logg 'Installing `volta` via `brew`' brew install volta fi if [ -z "$VOLTA_HOME" ]; then volta setup if [ -f "$HOME/.bashrc" ]; then . "$HOME/.bashrc" elif [ -f "$HOME/.zshrc" ]; then . "$HOME/.zshrc" else logg warn 'Could not find `.bashrc` or `.zshrc` to source the results of `volta setup` from' fi fi export PATH="$VOLTA_HOME/bin:$PATH" logg 'Installing `node` via `volta`' volta install node logg 'Installing `zx` via `volta`' volta install zx else logg '`brew` is unavailable to use to install `node` and `zx`' fi fi else logg '`zx` is already installed' fi