fix gf gen service ignore watch file dir windows platform bug (#1889)

This commit is contained in:
MZ
2022-06-06 19:56:44 +08:00
committed by GitHub
parent 0639becccc
commit 9e6e8001ca

View File

@ -65,7 +65,7 @@ func (c cGen) Service(ctx context.Context, in cGenServiceInput) (out *cGenServic
)
mlog.Debug("watchFileDir:", watchFileDir)
mlog.Debug("logicFolderDir:", srcFolderDir)
if !gstr.HasSuffix(srcFolderDir, in.SrcFolder) {
if !gstr.HasSuffix(gstr.Replace(srcFolderDir, `\`, `/`), in.SrcFolder) {
mlog.Printf(`ignore watch file "%s", not in source path "%s"`, in.WatchFile, in.SrcFolder)
return
}