Skip to content
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

feat: disable showing sdk manager progress #838

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mkg20001
Copy link
Contributor

It has no quiet mode and causes between 10 and 100 MEGABYTES of log
spam. I mean c'mon.

So let's just discard all of that using a simple grep vanish

It has no quiet mode and causes between 10 and 100 MEGABYTES of log 
spam. I mean c'mon.

So let's just discard all of that using a simple grep vanish
@mkg20001
Copy link
Contributor Author

Fixes #837

if "CI" in environ:
sdkmanager_commands = list(sdkmanager_commands)
sdkmanager_commands.insert(len(sdkmanager_commands), '>/dev/null') # mute stdout, important stuff goes to stderr anyways
sdkmanager_commands = tuple(sdkmanager_commands)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not skipping this whole part since you already introduced the grep -v "^\\[" fix in the _sdkmanager() method above?

if "CI" in environ and ">/dev/null" not in args:
args = list(args)
args.insert(len(args), ' | grep -v "^\\["')
args = tuple(args)
command = self.sdkmanager_path + ' ' + ' '.join(args)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead if this 4 lines of code "adding" the grep o the args. I think it would be more simple to go after the command = self.sdkmanager_path + ' ' + ' '.join(args) line and to do something like:

if 'CI' in environ:
    # hide download lines which look like "[=          ] 10% Downloading platform-tools"
    command += r' | grep -v "^\["'

Also note that I've used a raw-string to make the grep expression more readable (by skipping the double escaping of the \).
Last I've added a little code comment because it's not super obvious what we are doing

Copy link
Member

@AndreMiras AndreMiras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for addressing this.
I've left a couple of comment, would you mind addressing it 🙏

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

Successfully merging this pull request may close these issues.

None yet

2 participants