Skip to content

Commit

Permalink
moved code involving cd closer to use
Browse files Browse the repository at this point in the history
  • Loading branch information
Chrisyhjiang committed Jul 3, 2024
1 parent 9daa51b commit 52c9ae3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/cmd/cli/command/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -562,17 +562,13 @@ var generateCmd = &cobra.Command{

term.Info("Code generated successfully in folder", prompt.Folder)

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

// Load the project and check for empty environment variables
loader := compose.Loader{ComposeFilePath: filepath.Join(prompt.Folder, "compose.yaml")}
project, err := loader.LoadCompose(cmd.Context())
if err != nil {
return err
}

envInstructions := ""
for _, service := range project.Services {
envVars := make([]string, 0)
Expand All @@ -586,6 +582,11 @@ var generateCmd = &cobra.Command{
}
}

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

// TODO: should we use EDITOR env var instead?
cmdd := exec.Command("code", ".")
err = cmdd.Start()
Expand Down

0 comments on commit 52c9ae3

Please sign in to comment.