mirror of
https://gitee.com/johng/gf.git
synced 2024-12-01 19:57:40 +08:00
fix version retrieving of goframe for command version (#2682)
This commit is contained in:
parent
9191003391
commit
8cc5338870
@ -70,6 +70,8 @@ func (c cVersion) getGFVersionOfCurrentProject() (string, error) {
|
|||||||
if gfile.Exists(goModPath) {
|
if gfile.Exists(goModPath) {
|
||||||
lines := gstr.SplitAndTrim(gfile.GetContents(goModPath), "\n")
|
lines := gstr.SplitAndTrim(gfile.GetContents(goModPath), "\n")
|
||||||
for _, line := range lines {
|
for _, line := range lines {
|
||||||
|
line = gstr.Trim(line)
|
||||||
|
line = gstr.TrimLeftStr(line, "require ")
|
||||||
line = gstr.Trim(line)
|
line = gstr.Trim(line)
|
||||||
// Version 1.
|
// Version 1.
|
||||||
match, err := gregex.MatchString(`^github\.com/gogf/gf\s+(.+)$`, line)
|
match, err := gregex.MatchString(`^github\.com/gogf/gf\s+(.+)$`, line)
|
||||||
|
Loading…
Reference in New Issue
Block a user