This repository has been archived by the owner on Jan 19, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add support for locations starting with
https://github.com/
#47Add support for locations starting with
https://github.com/
#47Changes from 1 commit
2712d12
be46c46
063aa8c
25f72a1
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does it affect? if there will be error you return
nullopt
and if not you'll unlikely to have error output at all. And even if you do, parsing of output will likely break.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It resolves issue:
sh: 1: gh: not found
in the original issue.I believe Bucky's intention was to run command line
gh --version
quietly (the function name isexecute_quiet
).While stdout was silenced, the stderr was still printing error (which was ignored anyway).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got you. in that case
cmd += "2> /dev/null"
sounds to me like more self-descriptiveThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In current usages of
execute_quiet
both2>&1
and2> /dev/null
are fine.If someone would like to read the
stderr
if the return code is 0 (there are such cases) with the existing solution he will have such chance. In yours we are losingstderr
output. So I will leave the current solution.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I doubt that could be a case. if we will have non-critical error output on zero return code that may corrupt parsing of a valid data. Ideally that should be similar to
subprocess.run
in python. i.e. stdout and stderr piping is customizable. but I would leave it to next issue if that will be really needed. If you believe your case is more likely to happen than mine, just leave comment likepipe error output from console to stdout so caller can parse error string
and I'll approveThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, done