code reformat, init fixes
This commit is contained in:
@ -12,16 +12,16 @@ import (
|
||||
|
||||
type LedoContext struct {
|
||||
*cli.Context
|
||||
Config *config.LedoFile
|
||||
Config *config.LedoFile
|
||||
ComposeArgs []string
|
||||
Mode mode.Mode
|
||||
Output string
|
||||
Mode mode.Mode
|
||||
Output string
|
||||
}
|
||||
|
||||
func InitCommand(ctx *cli.Context) *LedoContext {
|
||||
|
||||
var (
|
||||
c LedoContext
|
||||
c LedoContext
|
||||
cfg *config.LedoFile
|
||||
)
|
||||
|
||||
@ -39,8 +39,8 @@ func InitCommand(ctx *cli.Context) *LedoContext {
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
mode := mode.InitMode(modeYml, configYml)
|
||||
c.Mode = mode
|
||||
ledoMode := mode.InitMode(modeYml, configYml)
|
||||
c.Mode = ledoMode
|
||||
|
||||
c.Output = ctx.String("output")
|
||||
|
||||
@ -50,10 +50,10 @@ func InitCommand(ctx *cli.Context) *LedoContext {
|
||||
args := []string{"--env-file", ".env"}
|
||||
args = append(args, "--project-name", strings.ToLower(strings.Replace(c.Config.Docker.Name, "/", "-", -1)))
|
||||
|
||||
composes, _ := mode.GetModeConfig()
|
||||
composes, _ := ledoMode.GetModeConfig()
|
||||
for _, element := range composes {
|
||||
args = append(args, "-f")
|
||||
args = append(args, element)
|
||||
args = append(args, element)
|
||||
}
|
||||
|
||||
c.ComposeArgs = args
|
||||
@ -66,7 +66,7 @@ func LoadConfigFile() (*config.LedoFile, error) {
|
||||
|
||||
if _, err := os.Stat(configYml); err != nil {
|
||||
nilCfg := &config.LedoFile{}
|
||||
return nilCfg, err
|
||||
return nilCfg, err
|
||||
}
|
||||
|
||||
cfg, _ := config.NewLedoFile(configYml)
|
||||
@ -80,4 +80,4 @@ func (lx *LedoContext) ExecCmd(cmd string, cmdArgs []string) error {
|
||||
command.Stdout = os.Stdout
|
||||
command.Stderr = os.Stderr
|
||||
return command.Run()
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user