-
-
Notifications
You must be signed in to change notification settings - Fork 834
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
InfoCommand improvements #1562
InfoCommand improvements #1562
Conversation
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.
Cool! Nice changes.
Could you use Symfon's table helper instead of the padding?
@franzliedke I added a new heading & formatted all the text to use I tried to make the first row heading to use all 3 cells, but with the formatting it extends a bit too far. |
{ | ||
if (file_exists("$path/.git")) { | ||
$cwd = getcwd(); | ||
chdir($path); | ||
|
||
$output = []; | ||
$status = null; | ||
exec('git rev-parse HEAD', $output, $status); | ||
exec('git rev-parse HEAD 2> /dev/null', $output, $status); |
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.
Hmm, how does this behave on Windows?
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.
Oh, I hadn't thought about Windows 😕.
Seems like in Windows one can do > NUL
, but to support both at the same time is probably not possible.
I tried to find how I could suppress STDERR from exec
, but was unable to find anything. I may have been approaching that fix wrong.
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.
@datitisev See commit 96045ca, that should fix it, I think.
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.
@franzliedke Looks like it still works on macOS. 👍
See the following articles for more information: - https://www.24k.com.sg/blog-27.html - https://support.microsoft.com/en-us/help/110930/redirecting-error-messages-from-command-prompt-stderr-stdout Refs #1562.
Changes proposed in this pull request:
git rev-parse-head
Screenshot
Before:
After:
Confirmed
php vendor/bin/phpunit
).