Skip to content

Commit

Permalink
Add project to env ls
Browse files Browse the repository at this point in the history
  • Loading branch information
seanyeh committed Aug 19, 2024
1 parent 0825354 commit 1b64e40
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions cmd/esc/cli/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -479,12 +479,14 @@ func (c *testPulumiClient) ListEnvironments(

var envs []client.OrgEnvironment
for _, k := range names {
org, name, _ := strings.Cut(k, "/")
parts := strings.Split(k, "/")
org, projectName, envName := parts[0], parts[1], parts[2]

if orgName == "" || org == orgName {
envs = append(envs, client.OrgEnvironment{
Organization: org,
Name: name,
Project: projectName,
Name: envName,
})
}
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/esc/cli/env_ls.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ func newEnvLsCmd(env *envCommand) *cobra.Command {

for _, e := range allEnvs {
if e.Organization == "" {
fmt.Fprintln(env.esc.stdout, e.Name)
fmt.Fprintf(env.esc.stdout, "%v/%v\n", e.Project, e.Name)
} else {
fmt.Fprintf(env.esc.stdout, "%v/%v\n", e.Organization, e.Name)
fmt.Fprintf(env.esc.stdout, "%v/%v/%v\n", e.Organization, e.Project, e.Name)
}
}

Expand Down

0 comments on commit 1b64e40

Please sign in to comment.