Open JasonTheAdams opened 8 months ago
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
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.
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: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: