Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove FileMode from environment list #73

Merged
merged 1 commit into from
Aug 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 6 additions & 13 deletions internal/cmd/stack/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ package stack
import (
"encoding/base64"
"fmt"
"github.com/pkg/errors"
"io/ioutil"
"os"
"regexp"
"strings"

"github.com/pkg/errors"

"github.com/shurcooL/graphql"
"github.com/urfave/cli/v2"

Expand Down Expand Up @@ -41,14 +42,12 @@ type configElement struct {
Type ConfigType `graphql:"type" json:"type,omitempty"`
Value *string `graphql:"value" json:"value,omitempty"`
WriteOnly bool `graphql:"writeOnly" json:"writeOnly,omitempty"`
FileMode *string `graphql:"fileMode" json:"fileMode,omitempty"`
}

type listEnvElementOutput struct {
Name string `json:"name"`
Type string `json:"type"`
Value *string `json:"value"`
FileMode *string `json:"fileMode"`
Name string `json:"name"`
Type string `json:"type"`
Value *string `json:"value"`
// Context specifies the name of the context.
Context *string `json:"context"`
// Runtime is not printed, it's just used to determine output formatting.
Expand Down Expand Up @@ -157,7 +156,7 @@ func (e *listEnvCommand) listEnv(cliCtx *cli.Context) error {
}

func (e *listEnvCommand) showOutputsTable(outputs []listEnvElementOutput) error {
tableData := [][]string{{"Name", "Type", "Value", "File Mode", "Context"}}
tableData := [][]string{{"Name", "Type", "Value", "Context"}}
for _, output := range outputs {
var row []string

Expand All @@ -179,11 +178,6 @@ func (e *listEnvCommand) showOutputsTable(outputs []listEnvElementOutput) error
}
row = append(row, value)

if output.FileMode != nil {
row = append(row, *output.FileMode)
} else {
row = append(row, "")
}
if output.Context != nil {
row = append(row, *output.Context)
} else {
Expand Down Expand Up @@ -218,7 +212,6 @@ func (e *configElement) toConfigElementOutput(contextName *string) (listEnvEleme
Name: e.ID,
Type: string(e.Type),
Value: value,
FileMode: e.FileMode,
Context: contextName,
Runtime: e.Runtime,
WriteOnly: e.WriteOnly,
Expand Down