Skip to content

Commit

Permalink
Merge pull request #102 from wandera/fix_whitespace
Browse files Browse the repository at this point in the history
fix trailing whitespaces in mappings
  • Loading branch information
jizi authored Apr 26, 2024
2 parents 04516bf + b67d917 commit e639cc2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cmd/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cmd
import (
"fmt"
"os"
"strings"

log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -60,7 +61,7 @@ func ExecuteGetValues() error {
log.Debug("Config server response:")
log.Debug(resp)

//#nosec G306
// #nosec G306
if err = os.WriteFile(gp.destination, []byte(resp), 0o644); err != nil {
return err
}
Expand All @@ -78,7 +79,7 @@ func ExecuteGetFiles() error {
for _, mapping := range gp.fileMappings.Mappings() {
resp, err := client.
NewClient(client.Config{URI: gp.source, Profile: gp.profile, Application: gp.application, Label: gp.label}).
FetchFileE(mapping.source)
FetchFileE(strings.TrimSpace(mapping.source))
if err != nil {
return err
}
Expand All @@ -91,7 +92,7 @@ func ExecuteGetFiles() error {
fmt.Println()
log.Debug("Response written to stdout")
} else {
//#nosec G306
// #nosec G306
if err = os.WriteFile(mapping.destination, resp, 0o644); err != nil {
return err
}
Expand Down

0 comments on commit e639cc2

Please sign in to comment.