Skip to content

Commit

Permalink
refactor (zeromicro#48)
Browse files Browse the repository at this point in the history
* rebase upstream

* rebase

* trim no need line

* trim no need line

* trim no need line

* refactor gomod module logic

Co-authored-by: kingxt <[email protected]>
  • Loading branch information
kingxt and kingxt authored Sep 7, 2020
1 parent 1602f6c commit 2b81516
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tools/goctl/util/project/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,12 @@ func Prepare(projectDir string, checkGrpcEnv bool) (*Project, error) {
}

if !strings.HasPrefix(pwd, src) {
name = filepath.Clean(filepath.Base(projectDir))
absPath, err := filepath.Abs(projectDir)
if err != nil {
return nil, err
}

name = filepath.Clean(filepath.Base(absPath))
path = projectDir
} else {
r := strings.TrimPrefix(pwd, src+string(filepath.Separator))
Expand Down

0 comments on commit 2b81516

Please sign in to comment.