fix #1252 check LLGO_ROOT with pkg github.com/goplus/llgo/runtime
This commit is contained in:
4
internal/env/env.go
vendored
4
internal/env/env.go
vendored
@@ -97,12 +97,12 @@ func isLLGoRoot(root string) (string, bool) {
|
||||
return "", false
|
||||
}
|
||||
// Check for go.mod
|
||||
data, err := os.ReadFile(filepath.Join(root, "go.mod"))
|
||||
data, err := os.ReadFile(filepath.Join(root, LLGoRuntimePkgName, "go.mod"))
|
||||
if err != nil {
|
||||
return "", false
|
||||
}
|
||||
// Check module name
|
||||
if !strings.Contains(string(data), "module "+LLGoCompilerPkg+"\n") {
|
||||
if !strings.Contains(string(data), "module "+LLGoRuntimePkg+"\n") {
|
||||
return "", false
|
||||
}
|
||||
return root, true
|
||||
|
||||
Reference in New Issue
Block a user