Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
Reduce ammount of indent calls
Browse files Browse the repository at this point in the history
Signed-off-by: Ari Archer <[email protected]>
  • Loading branch information
Ari Archer committed May 20, 2022
1 parent 4dacb1b commit 72225e7
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions baz
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[ "$BAZ_DEBUG" ] && set -x

export BAZ_VERSION='1.3.3'
export BAZ_VERSION='1.3.4'
export BAZ_DIR="$HOME/.local/share/baz"
export BAZ_CONFDIR="$HOME/.config/baz"
export BAZ_CONF="$BAZ_CONFDIR/config.env"
Expand Down Expand Up @@ -470,9 +470,11 @@ baz_install() {
[ ! "$2" ] && error 'no atom specified'

log 'Will install:'
for dir in "${@:2}"; do
log "$dir" | indent
done
{
for dir in "${@:2}"; do
log "$dir"
done
} | indent
eecho

if [ "$BAZP_NO_ASKINST" != 'true' ]; then
Expand All @@ -492,14 +494,16 @@ baz_install() {
baz_uinstall() {
log 'Will uninstall:'

for plugin in "$@"; do
if [ ! -d "$BAZ_PLUGDIR/$plugin" ]; then
error "Plugin '$plugin' not installed" | indent
return 1
fi
{
for plugin in "$@"; do
if [ ! -d "$BAZ_PLUGDIR/$plugin" ]; then
error "Plugin '$plugin' not installed"
return 1
fi

log "$plugin" | indent
done
log "$plugin"
done
} | indent
eecho

yn 'Are you sure?' &&
Expand All @@ -516,9 +520,11 @@ baz_list() {

log 'Installed plugins:'

while read -r dir; do
log "$(get_base "$dir")" | indent >&2
done <<<"$(find "$BAZ_PLUGDIR" -maxdepth 1 -not -path "$BAZ_PLUGDIR" -type d)"
{
while read -r dir; do
log "$(get_base "$dir")"
done <<<"$(find "$BAZ_PLUGDIR" -maxdepth 1 -not -path "$BAZ_PLUGDIR" -type d)"
} | indent >&2
}

baz_update() {
Expand Down

0 comments on commit 72225e7

Please sign in to comment.