Skip to content

Commit

Permalink
fix version retrieving of goframe for command version (gogf#2682)
Browse files Browse the repository at this point in the history
  • Loading branch information
gqcn authored Jun 2, 2023
1 parent 9191003 commit 8cc5338
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/gf/internal/cmd/cmd_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ func (c cVersion) getGFVersionOfCurrentProject() (string, error) {
if gfile.Exists(goModPath) {
lines := gstr.SplitAndTrim(gfile.GetContents(goModPath), "\n")
for _, line := range lines {
line = gstr.Trim(line)
line = gstr.TrimLeftStr(line, "require ")
line = gstr.Trim(line)
// Version 1.
match, err := gregex.MatchString(`^github\.com/gogf/gf\s+(.+)$`, line)
Expand Down

0 comments on commit 8cc5338

Please sign in to comment.