Skip to content

add debug option to setup-environment-commands #289

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

molleweide
Copy link
Collaborator

@molleweide molleweide commented Feb 21, 2025

  • adds an args processing while loop
  • adds debug flag that allows for detailed logging of env before and after setup-environment-commands. --debug sets a variable that allows env.bash print in detail what happens so that you can diagnose exactly what happens.

I think this is preparatory to moving #288 into SEC so that you can more easilly debug what happens when you are playing around with the cache.

- adds an args processing while loop
- adds debug flag that allows for detailed logging of env before and
  after `setup-environment-commands`
@balupton
Copy link
Member

Interesting. The WIP stuff I'm doing has a __debug_lines helper in bash.bash.

Why --debug here better than debug-bash -x -- setup-environment-commands

@molleweide
Copy link
Collaborator Author

Interesting. The WIP stuff I'm doing has a __debug_lines helper in bash.bash.

Yeah, i know ;)

Why --debug here better than debug-bash -x -- setup-environment-commands

Good question. I realized the set -x exists but i think that sometimes just creates too much output, and if you are unsure of what has happened then you might have to put it in a handful places. So, just passing --debug and then have it print everything in a nice and concise manner seems more useful in some cases.

For example, I had a path with oh-my-zsh that i couldnt understand why it was not being set correctly. Using the --debug flag made it possible to see that "Ahaa, it was already being set before dorothy for some reason and so the debug showed variable 'variable was modified' and now things made sense."

Also, with the history issue we both experience, atm i could not scroll back far enough to check the value in the output. etc etc.

@balupton
Copy link
Member

Makes sense. Let's reevaluate after devilbird merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants