fix the source code directory after the soft link (#4425)

This commit is contained in:
yangjinheng 2024-10-19 23:37:44 +08:00 committed by GitHub
parent 94e476ade7
commit 796dd5b6e2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -9,6 +9,7 @@ import (
"strings"
"github.com/zeromicro/go-zero/tools/goctl/rpc/execx"
"github.com/zeromicro/go-zero/tools/goctl/util/pathx"
)
// GenPb generates the pb.go file, which is a layer of packaging for protoc to generate gprc,
@ -88,7 +89,7 @@ func findPbFile(current string, src string, grpc bool) (string, error) {
return nil
})
if errors.Is(err, os.ErrExist) {
return filepath.Dir(filepath.Join(current, ret)), nil
return pathx.ReadLink(filepath.Dir(filepath.Join(current, ret)))
}
return "", err
}