You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: