From d55a498b33e03450b4b501f5474752cb1a966076 Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Thu, 24 Aug 2023 13:59:31 +0200 Subject: [PATCH] fix lateststableDump --- cmd/internal/database/meilisearch/meilisearch.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmd/internal/database/meilisearch/meilisearch.go b/cmd/internal/database/meilisearch/meilisearch.go index 91c2a2b..8d80605 100644 --- a/cmd/internal/database/meilisearch/meilisearch.go +++ b/cmd/internal/database/meilisearch/meilisearch.go @@ -235,9 +235,14 @@ func (db *Meilisearch) getBinaryVersion() (int, error) { return 0, fmt.Errorf("unable to detect meilisearch binary version: %w", err) } - v, err := semver.NewVersion(strings.TrimSpace(string(out))) + _, binaryVersionString, found := strings.Cut(string(out), "meilisearch ") + if !found { + return 0, fmt.Errorf("unable to detect meilisearch binary version in %q", binaryVersionString) + } + + v, err := semver.NewVersion(strings.TrimSpace(binaryVersionString)) if err != nil { - return 0, fmt.Errorf("unable to parse postgres binary version in %q: %w", string(out), err) + return 0, fmt.Errorf("unable to parse meilisearch binary version in %q: %w", binaryVersionString, err) } // TODO check major