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

Commit

Permalink
Improve updating logging
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 21, 2022
1 parent c6c0d0c commit 5af3408
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
18 changes: 4 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.4.0'
export BAZ_VERSION='1.4.1'
export BAZ_DIR="$HOME/.local/share/baz"
export BAZ_CONFDIR="$HOME/.config/baz"
export BAZ_CONF="$BAZ_CONFDIR/config.env"
Expand Down Expand Up @@ -84,11 +84,7 @@ baz_update_plugin_git() {

BAZP_NO_LOG=false

if [ "$new_ver" == "$old_ver" ]; then
log "Plugin '$1' is up to date"
else
log "Updated '$1' from v$old_ver -> v$new_ver"
fi
[ "$new_ver" != "$old_ver" ] && log "Updated '$1' from v$old_ver -> v$new_ver"
}

baz_update_plugin_local() {
Expand All @@ -112,8 +108,8 @@ baz_update_plugin_local() {

BAZP_NO_LOG=false

[ "$new_ver" == "$old_ver" ] && log "Plugin '$1' is up to date" && return
log "Updating $1 from v$old_ver -> v$new_ver"
[ "$new_ver" == "$old_ver" ] && return
log "Updating '$1' from v$old_ver -> v$new_ver"

# I am in pain how stupid this expression is
# Btw can't use -exec or find breaks
Expand All @@ -127,10 +123,6 @@ baz_update_plugin_local() {

baz_update_plugin() {
bplug="$(get_base "$1")"

log "Updating plugin: $bplug" |
indent | indent

cd -- "$1"

method="$(head -n 1 method)"
Expand All @@ -142,8 +134,6 @@ baz_update_plugin() {
$fn "$bplug"

cd -- "$BAZP_INITDIR"

log "Updated plugin: $bplug" | indent
}

describe_env() {
Expand Down
2 changes: 1 addition & 1 deletion examples/example_plugin/baz.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export BAZP_NAME='example'
export BAZP_LICENSE='WTFPL'
export BAZP_VER=4
export BAZP_VER=3
export BAZP_AUTHOR='Ari Archer'
export BAZP_SRC='plugin'
export BAZP_METHOD='local'
Expand Down

0 comments on commit 5af3408

Please sign in to comment.