blue-build / modules

BlueBuild standard modules used for building your Atomic Images
Apache License 2.0
22 stars 26 forks source link

bug(chezmoi): Running in debug mode. If you didn't enable this yourself, this is a bug. #221

Closed fiftydinar closed 1 month ago

fiftydinar commented 1 month ago

I didn't enable this, yet it prints every executed command in logs.

Bug probably resides here:

DEBUG=false
if [[ $DEBUG ]]; then
    echo "Running in debug mode. If you didn't enable this yourself, this is a bug."
    set -vux
fi

While $DEBUG string here means "true", it somehow didn't catch that. Maybe doing something like this will solve this problem:

DEBUG=false
if [[ "$DEBUG" == "true" ]]; then
    echo "Running in debug mode. If you didn't enable this yourself, this is a bug."
    set -vux
fi
fiftydinar commented 1 month ago

@exponentactivity Here's another ping heh

fiftydinar commented 1 month ago

It seems that if [[ $DEBUG ]]; then here just assumes if variable is empty or not, while

if $DEBUG; then assumes if variable is set to true.

exponentactivity commented 1 month ago

Thanks for reporting! I'm just waiting for my other PR to be merged and i will push a solution for this.

It's a bit embarrassing, i fixed several of the same problems in my initial PR and missed this. My brain becomes like teflon when it needs to remember bash syntax.