fix: handle StackName / Name correctly

This commit is contained in:
2022-01-01 17:22:19 +01:00
parent 1b7836009f
commit a556ca625b
7 changed files with 29 additions and 27 deletions

View File

@ -43,13 +43,17 @@ type App struct {
Path string
}
// StackName gets what the docker safe stack name is for the app
// StackName gets what the docker safe stack name is for the app. This should
// not not shown to the user, use a.Name for that. Give the output of this
// command to Docker only.
func (a App) StackName() string {
if _, exists := a.Env["STACK_NAME"]; exists {
return a.Env["STACK_NAME"]
}
stackName := SanitiseAppName(a.Name)
a.Env["STACK_NAME"] = stackName
return stackName
}