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

Add ability to retrieve plain version from PHAR #92

Open
JasonTheAdams opened this issue Mar 27, 2024 · 3 comments
Open

Add ability to retrieve plain version from PHAR #92

JasonTheAdams opened this issue Mar 27, 2024 · 3 comments

Comments

@JasonTheAdams
Copy link

Our team uses the PHAR version to run Strauss to avoid dependency issues. When our build system goes to run Strauss, it checks of the PHAR is available locally, and then downloads it if not before running it. The risk, here, is that devs may have an old downloaded version. To get around this, we make a file that stores the downloaded version.

There's currently a --version flag that can be used, but it outputs something like:

strauss 0.16.0

It would be helpful to have a --plain-version (or equivalent) flag that strictly outputs the version so we can easily do a version check:

php strauss.phar --plain-version
---
0.16.0
@BrianHenryIE
Copy link
Owner

BrianHenryIE commented Apr 24, 2024

Hey. I'm not sure it's worth adding code for that, it's so simple in Bash:

$ strauss_version=$(strauss --version | sed 's/strauss //')
$ echo $strauss_version;
0.17.0
$ strauss --version | awk '{print $2}'
0.17.0

Edit: the --version command is a Symfony Console command, so you can trust it will always be the format: sprintf('%s <info>%s</info>', $this->getName(), $this->getVersion()) Application.php#L480

@JasonTheAdams
Copy link
Author

JasonTheAdams commented Apr 29, 2024

Hey Brian! Appreciate the input.

That assumes the context and circumstance. Is there a downside to having this? You mention Symfony, just a couple methods up from that code is the ability to get just the version in Symfony. There are different use cases for just getting the version versus getting a human-readable version.

@BrianHenryIE
Copy link
Owner

WIP: https://github.com/BrianHenryIE/strauss/compare/master...BrianHenryIE:strauss:issue92-plain-version?expand=1

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