one-click-apps
one-click-apps copied to clipboard
App issue: rocket.chat - version-check regex is too restrictive
https://github.com/caprover/one-click-apps/blob/544b2cfcab75f2e13cb039f84b7c8b68b7e81036/public/v4/apps/rocketchat.yml#L56
This regex aiming to enforce version >5.0.4 is too restrictive regarding following minor versions: e.g. it rejects version 5.1.3 because x.x.3 < x.x.4 even if minor version number bumped from 0 to 1.
I came to this solution that keeps your prerequisite while allowing every more recent versions:
^(?(?=5\.0)5\.0\.[4-9]|(?=[5-9])[5-9]\.[0-9]\.[0-9])$
You will find test cases here to demonstrate.
PS: not sure this is the best way of doing it but that works... if a regex guru passes by, I'll be please to improve :)