fix: 解决已安装应用包含大写字母,启动失败的BUG (#559)

This commit is contained in:
zhengkunwang223
2023-04-10 14:44:23 +08:00
committed by GitHub
parent 4a4c2b24dd
commit 47d090d481
2 changed files with 6 additions and 2 deletions

View File

@@ -11,6 +11,7 @@ import (
"github.com/docker/docker/client"
"github.com/joho/godotenv"
"path"
"regexp"
"strings"
"time"
)
@@ -103,6 +104,9 @@ func GetComposeProject(projectName, workDir string, yml []byte, env []byte, skip
ConfigFiles: configFiles,
Environment: envMap,
}
projectName = strings.ToLower(projectName)
reg, _ := regexp.Compile(`[^a-z0-9_-]+`)
projectName = reg.ReplaceAllString(projectName, "")
project, err := loader.Load(details, func(options *loader.Options) {
options.SetProjectName(projectName, true)
options.ResolvePaths = true