MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / loadEnv

Function loadEnv

agent/app/service/container_compose.go:452–466  ·  view source on GitHub ↗
(list []dto.ComposeInfo)

Source from the content-addressed store, hash-verified

450}
451
452func loadEnv(list []dto.ComposeInfo) []dto.ComposeInfo {
453 for i := 0; i < len(list); i++ {
454 tmpPath := list[i].Path
455 if strings.Contains(list[i].Path, ",") {
456 tmpPath = strings.Split(list[i].Path, ",")[0]
457 }
458 envFilePath := path.Join(path.Dir(tmpPath), ".env")
459 file, err := os.ReadFile(envFilePath)
460 if err != nil {
461 continue
462 }
463 list[i].Env = string(file)
464 }
465 return list
466}
467
468func newComposeEnv(pathItem string, env string) error {
469 envFilePath := path.Join(path.Dir(pathItem), ".env")

Callers 2

vite.config.tsFile · 0.85
PageComposeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected