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

Option for suggest command to output just the suggested version #19

Open
SebSept opened this issue May 29, 2015 · 5 comments
Open

Option for suggest command to output just the suggested version #19

SebSept opened this issue May 29, 2015 · 5 comments

Comments

@SebSept
Copy link

SebSept commented May 29, 2015

/php-semver-checker-git.phar suggest  --only-version "./" "./" 

So it output only

0.4.0

Or maybe the result like :

Testing HEAD against tag: 0.3.1

Initial semantic version: 0.3.1
Suggested semantic version: 0.4.0

should be display only with the -v option passed

What do you think of that ?

@tomzx
Copy link
Owner

tomzx commented May 29, 2015

I wouldn't mind, but for what purpose would you need it?

Other than that, it is pretty easy to write a wrapper script that extracts the version out of the final output.

@SebSept
Copy link
Author

SebSept commented Jun 1, 2015

I'd like to replace a placeholder in the code with the php-semver-checker-git result. So Application version is automatically updated.
So a git hook, before commit, can replace that placeholder with the suggested version.
(That's a symfony console app packaged as phar - http://api.symfony.com/master/index.html?q=setVersion )

@tomzx tomzx modified the milestone: Candidate for next Minor Jun 18, 2015
@SebSept
Copy link
Author

SebSept commented Jun 18, 2015

this can do the trick with awk

./php-semver-checker-git.phar suggest | awk '/Suggested semantic version: / {print $4}'

so maybe this is not a relevant enhancement ...

@tomzx
Copy link
Owner

tomzx commented Jun 18, 2015

@SebSept As long as the output of php-semver-checker-git does not change, absolutely.

However, I do think there's some value in outputting only the suggested semantic version number. I'll try to figure out an appropriate solution when I have some free time.

@SebSept
Copy link
Author

SebSept commented Jun 19, 2015 via email

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

No branches or pull requests

2 participants