Skip to content

Commit

Permalink
Fix scripts env
Browse files Browse the repository at this point in the history
  • Loading branch information
Andriiklymiuk committed Sep 3, 2024
1 parent 4e82742 commit ce77919
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
24 changes: 12 additions & 12 deletions utils/generateEnv.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ce77919

Please sign in to comment.