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

Feat: Support old versions #11 #15

Open
Cevedale opened this issue Nov 20, 2023 · 0 comments
Open

Feat: Support old versions #11 #15

Cevedale opened this issue Nov 20, 2023 · 0 comments

Comments

@Cevedale
Copy link

you can modify it like that maybe:

const match = stdout.match(/(?:^|\s)forge\s+(\d+.\d+.\d+)/);

This modification allows for different prefixes before the version number, such as "snforge" or just "forge". The (?:^|\s) part of the regular expression matches the start of the string or any whitespace character, making it more adaptable to different scenarios. After the match, you can retrieve the version number using match[1]. Make sure to check for null in case of no match to avoid errors.

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

No branches or pull requests

1 participant