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

Revert "Add standard newline/quoting behavior to dotenv store" #706

Merged
merged 1 commit into from
Jul 27, 2020
Merged
Show file tree
Hide file tree
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
20 changes: 8 additions & 12 deletions cmd/sops/subcommand/exec/exec.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package exec

import (
"fmt"
"bytes"
"io/ioutil"
"os"
"runtime"
"strings"

"go.mozilla.org/sops/v3/logging"
"go.mozilla.org/sops/v3/stores/dotenv"

"github.com/sirupsen/logrus"
)
Expand Down Expand Up @@ -85,18 +84,15 @@ func ExecWithEnv(opts ExecOpts) error {
}

env := os.Environ()
store := dotenv.Store{}

branches, err := store.LoadPlainFile(opts.Plaintext)
if err != nil {
log.Fatal(err)
}

for _, item := range branches[0] {
if item.Value == nil {
lines := bytes.Split(opts.Plaintext, []byte("\n"))
for _, line := range lines {
if len(line) == 0 {
continue
}
if line[0] == '#' {
continue
}
env = append(env, fmt.Sprintf("%s=%s", item.Key, item.Value))
env = append(env, string(line))
}

cmd := BuildCommand(opts.Command)
Expand Down
311 changes: 0 additions & 311 deletions stores/dotenv/parser.go

This file was deleted.

Loading