Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
RyosukeCla committed Apr 13, 2023
1 parent ff14de1 commit 3c94250
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"bufio"
"bytes"
"context"
"encoding/base64"
"flag"
"fmt"
"log"
Expand Down Expand Up @@ -45,11 +44,8 @@ func main() {
if err != nil {
log.Fatalf("failed to get secret (%s): %v", value, err)
}
env, err := base64.RawStdEncoding.DecodeString(string(access.Payload.Data))
if err != nil {
log.Fatalf("failed to decode secret (%s): %v", value, err)
}
escaped := string(env)

escaped := string(access.Payload.Data)
if flags.removeWhitespace {
escaped = strings.ReplaceAll(escaped, "'", "'\"'\"'")
escaped = strings.ReplaceAll(escaped, "\n", "\\n")
Expand Down Expand Up @@ -77,12 +73,6 @@ func main() {
log.Fatalf("failed to write output: %v", err)
}
writer.Flush()

envs, err = envparse.Parse(bytes.NewReader(outputBytes))
if err != nil {
log.Fatalf("failed to parse output: %v", err)
}
fmt.Printf("TEST: %s", strings.ReplaceAll(envs["TEST"], "\n", "NN"))
}

type flags struct {
Expand Down

0 comments on commit 3c94250

Please sign in to comment.