feat: disable showing sdk manager progress#838
Conversation
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
…ndroid_update_sdk
|
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) |
There was a problem hiding this comment.
why not skipping this whole part since you already introduced the grep -v "^\\[" fix in the _sdkmanager() method above?
| args = list(args) | ||
| args.insert(len(args), ' | grep -v "^\\["') | ||
| args = tuple(args) | ||
| command = self.sdkmanager_path + ' ' + ' '.join(args) |
There was a problem hiding this comment.
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
AndreMiras
left a comment
There was a problem hiding this comment.
Thank you very much for addressing this.
I've left a couple of comment, would you mind addressing it 🙏
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