diff --git a/cmd/root.go b/cmd/root.go index b409393..937443a 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -6,7 +6,7 @@ import ( "github.com/spf13/cobra" ) -var APP_VERSION = "1.7.4" +var APP_VERSION = "1.7.5" // rootCmd represents the base command when called without any subcommands var rootCmd = &cobra.Command{ diff --git a/utils/generateEnv.go b/utils/generateEnv.go index f92057b..0a63cbb 100644 --- a/utils/generateEnv.go +++ b/utils/generateEnv.go @@ -205,21 +205,21 @@ func GenerateEnvForService( fmt.Sprintf("\n%s=%d", portAlias, service.Port), ) } - } - if len(service.Environment) > 0 { - // Parse existing environment variables from envForService into a map for easy lookup. - existingEnvVars := parseEnvVarsIntoMap(envForService) + if len(service.Environment) > 0 { + // Parse existing environment variables from envForService into a map for easy lookup. + existingEnvVars := parseEnvVarsIntoMap(envForService) - var updatedEnvironment []string - for _, envLine := range service.Environment { - // Process each environment variable line for potential substitutions. - updatedEnvLine := substituteEnvVarReferences(envLine, existingEnvVars) - updatedEnvironment = append(updatedEnvironment, updatedEnvLine) - } + var updatedEnvironment []string + for _, envLine := range service.Environment { + // Process each environment variable line for potential substitutions. + updatedEnvLine := substituteEnvVarReferences(envLine, existingEnvVars) + updatedEnvironment = append(updatedEnvironment, updatedEnvLine) + } - // Join the updated environment strings and add them to envForService. - envForService += "\n" + strings.Join(updatedEnvironment, "\n") + "\n" + // Join the updated environment strings and add them to envForService. + envForService += "\n" + strings.Join(updatedEnvironment, "\n") + "\n" + } } pathToEnvFile := getPathToEnv(service)