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

Support old versions #11

Open
DelevoXDG opened this issue Nov 10, 2023 · 1 comment
Open

Support old versions #11

DelevoXDG opened this issue Nov 10, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@DelevoXDG
Copy link

DelevoXDG commented Nov 10, 2023

Currently, setting up the old snfoundry versions fails because of a different snfoundry -V output:
https://github.com/software-mansion/starknet-jvm/actions/runs/6826261535/job/18565799546

Error: Error: unable to determine Starknet Foundry version from 'snforge -V' output: forge 0.6.0
const match = stdout.match(/^snforge ([^ ]+)/);

I think we can modify this to support matching forge <ver> as well, or any x.y.z pattern regardless of prefix.

@DelevoXDG DelevoXDG added the bug Something isn't working label Nov 10, 2023
@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
bug Something isn't working
Projects
Status: Triage
Development

No branches or pull requests

2 participants