Skip to content

fix(install_snapraid): use regex_search for version extraction#136

Open
adamantike wants to merge 1 commit intomonstermuffin:mainfrom
adamantike:fix/snapraid-version-number-extraction
Open

fix(install_snapraid): use regex_search for version extraction#136
adamantike wants to merge 1 commit intomonstermuffin:mainfrom
adamantike:fix/snapraid-version-number-extraction

Conversation

@adamantike
Copy link
Copy Markdown

SnapRAID v14 changed its --version output:

  • Before: SnapRAID v13.0 by Andrea Mazzoleni, https://www.snapraid.it
  • After: SnapRAID CLI v14.1 by Andrea Mazzoleni, https://www.snapraid.it

This breaks the current approach of using split()[1] to extract the version number.

Replace with regex_search using v?(\d[\d.]*) to locate the version token regardless of position, while remaining compatible with older output formats and version strings without a "v" prefix.

SnapRAID v14 changed its `--version` output:
- Before: `SnapRAID v13.0 by Andrea Mazzoleni, https://www.snapraid.it`
- After: `SnapRAID CLI v14.1 by Andrea Mazzoleni, https://www.snapraid.it`

This breaks the current approach of using `split()[1]` to extract the
version number.

Replace with `regex_search` using `v?(\d[\d.]*)` to locate the version token
regardless of position, while remaining compatible with older output formats
and version strings without a "v" prefix.
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

Successfully merging this pull request may close these issues.

1 participant