Skip to content
This repository was archived by the owner on Jul 23, 2025. It is now read-only.
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions atlasexec/atlas.go
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ func (c *Client) MigrateStatus(ctx context.Context, params *MigrateStatusParams)
return firstResult(jsonDecode[MigrateStatus](c.runCommand(ctx, args)))
}

var reVersion = regexp.MustCompile(`^atlas version v(\d+\.\d+.\d+)-?([a-z0-9]*)?`)
var reVersion = regexp.MustCompile(`^atlas( community)? version v(\d+\.\d+.\d+)-?([a-z0-9]*)?`)

// Version runs the 'version' command.
func (c *Client) Version(ctx context.Context) (*Version, error) {
Expand All @@ -551,11 +551,11 @@ func (c *Client) Version(ctx context.Context) (*Version, error) {
return nil, errors.New("unexpected output format")
}
var sha string
if len(v) > 2 {
sha = string(v[2])
if len(v) > 3 {
sha = string(v[3])
}
return &Version{
Version: string(v[1]),
Version: string(v[2]),
SHA: sha,
Canary: strings.Contains(string(out), "canary"),
}, nil
Expand Down