infinitered / solidarity

Solidarity is an environment checker for project dependencies across multiple machines.
https://infinitered.github.io/solidarity/
MIT License
639 stars 49 forks source link

Version without leading `v` fails check #252

Open DanielMSchmidt opened 4 years ago

DanielMSchmidt commented 4 years ago

I have a check for kind 0.6.1 which has the kind --version output of kind version 0.6.1. It fails with ✖ No version was detected from the output of the binary 'kind'

When kind was in version 0.5.1 the output was kind version v0.5.1, which was parsed successfully.

My rule definition is

{
  "$schema": "http://json.schemastore.org/solidaritySchema",
  "requirements": {
    "Node": [
      {
        "rule": "cli",
        "binary": "node",
        "semver": ">= 12.9.1"
      }
    ],
    "kind": [
      {
        "rule": "cli",
        "binary": "kind",
        "semver": "0.6.1"
      }
    ],
  }
}
GantMan commented 4 years ago

Hrmmm, seems like the regex is getting messed up by the v This code should have fixed it: https://github.com/infinitered/solidarity/blob/master/src/extensions/functions/removeNonVersionCharacters.ts

Let me dig deeper

GantMan commented 4 years ago

Can you verify kind -v fails? BC if it doesn't that's the problem. It tries -v first.