From 7a2a1f66aed1f0191cd305417d7380e313f53c9f Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Tue, 24 Sep 2019 08:00:57 -0400 Subject: [PATCH] updated bakefile with brew_pretty --- Bakefile | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Bakefile b/Bakefile index b298f99..c32b16f 100644 --- a/Bakefile +++ b/Bakefile @@ -5,7 +5,7 @@ //: //system //python red "System is setup for local development." //system: //warn @confirm - lazy_brew pipenv bats + lazy_brew_pretty pipenv bats //python: @skip:key=Pipfile.lock //system pipenv install --dev test: docker/build @@ -69,18 +69,20 @@ random/python/ip: echo "$sparkescakesparkles" | pbcopy echo 'KR Copied!' | red --fg cyan -lazy_brew() { - set -e +lazy_brew_pretty() { # Install jq if it's not available. - if ! which jq > /dev/null; then - set -ex && brew install jq + if ! which -s jq; then + bake_step "Installing jq" + brew install jq 2>&1 | bake_indent --char $(red '|') fi + set +e # Install requested packages, if they aren't installed. - for PACKAGE in "$@"; do - if ! brew info --installed --json | jq 'map(.name) | index( "$PACKAGE" )' > /dev/null; then - set -ex && brew install "$PACKAGE" > /dev/null + for PACKAGE in "${@}"; do + if ! which -s ${PACKAGE}; then + bake_step "Installing ${PACKAGE}" --color green + brew install "${PACKAGE}" 2>&1 | bake_indent --char $(red '|') fi done }