Skip to content

Commit

Permalink
moved the location of the string and
Browse files Browse the repository at this point in the history
  • Loading branch information
Chrisyhjiang committed Jul 4, 2024
1 parent 2419aef commit fef34f3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/cmd/cli/command/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -572,21 +572,21 @@ var generateCmd = &cobra.Command{

cd := ""
if prompt.Folder != "." {
cd = "`cd " + prompt.Folder + "` "
cd = "`cd " + prompt.Folder + "` and "
}

// Load the project and check for empty environment variables
var envInstructions = ""
loader := compose.Loader{ComposeFilePath: filepath.Join(prompt.Folder, "compose.yaml")}
project, _ := loader.LoadCompose(cmd.Context())

envVars := collectUnsetEnvVars(project) // ir err != nil -> proj == nil, which is handled in the collectUnsetEnvVars function
envVars := collectUnsetEnvVars(project) // if err != nil -> proj == nil, which is handled in the collectUnsetEnvVars function
envInstructions = strings.Join(envVars, " ")

if envInstructions != "" { // logic needs to be duplicated in case where no env vars in yaml file.
printDefangHint("Check the files in your favorite editor.\nTo deploy the service, do "+cd+"and ", "config set "+envInstructions)
printDefangHint("Check the files in your favorite editor.\nTo deploy the service, do "+cd, "config set "+envInstructions)
} else {
printDefangHint("Check the files in your favorite editor.\nTo deploy the service, do "+cd+"and ", "compose up")
printDefangHint("Check the files in your favorite editor.\nTo deploy the service, do "+cd, "compose up")
}

return nil
Expand Down

0 comments on commit fef34f3

Please sign in to comment.