-
Notifications
You must be signed in to change notification settings - Fork 89
Missing symfony/process dependancy #24
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
Comments
Yeah you're right. It wasn't picked up during development because |
Hi guys! My suggestion: if (! function_exists('git_version')) {
/**
* Get latest git tag version.
*
* @return string
*/
function git_version()
{
$gitCommand = 'git describe --tags $(git rev-list --tags --max-count=1)';
if (class_exists('Symfony\Component\Process\Process')) {
$process = (new Symfony\Component\Process\Process($gitCommand))->run();
return trim($process->getOutput());
}
return trim(exec($gitCommand)); // Or shell_exec
}
} In this way we do not need to add 'symfony/process' as a dependency of the project, and we can use it without worry as long as it is a dependency of 'symfony/console' |
That's better, but now that I think about it, I'd prefer not to use git to determine this because the version should work on computers without git installed. |
@BrainMaestro OK no problems! This function is not essential for the operation of the package, it can be removed if you prefer. 😄 |
It was a good idea because I always forget to update the string, but oh well. Do you want to make a PR? |
I can send a PR at night (my time zone is UTC -3, now it's 9:20 am here). |
@BrainMaestro Here is a version with |
Uh oh!
There was an error while loading. Please reload this page.
Introduced in #23.
composer-git-hooks/src/helpers.php
Line 3 in d3ba750
However,
symfony/process
is missing fromcomposer.json
:composer-git-hooks/composer.json
Lines 18 to 21 in d3ba750
The text was updated successfully, but these errors were encountered: