File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -137,6 +137,10 @@ func main() {
137137 Name : "background" ,
138138 Usage : "background the process and don't wait for it to complete" ,
139139 },
140+ cli.BoolFlag {
141+ Name : "pristine" ,
142+ Usage : "insert only the decrypted values into the environment without forwarding existing environment variables" ,
143+ },
140144 cli.StringFlag {
141145 Name : "user" ,
142146 Usage : "the user to run the command as" ,
@@ -171,6 +175,7 @@ func main() {
171175 Command : command ,
172176 Plaintext : output ,
173177 Background : c .Bool ("background" ),
178+ Pristine : c .Bool ("pristine" ),
174179 User : c .String ("user" ),
175180 }); err != nil {
176181 return toExitError (err )
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ type ExecOpts struct {
2121 Command string
2222 Plaintext []byte
2323 Background bool
24+ Pristine bool
2425 Fifo bool
2526 User string
2627 Filename string
@@ -83,7 +84,12 @@ func ExecWithEnv(opts ExecOpts) error {
8384 SwitchUser (opts .User )
8485 }
8586
86- env := os .Environ ()
87+ var env []string
88+
89+ if ! opts .Pristine {
90+ env = os .Environ ()
91+ }
92+
8793 lines := bytes .Split (opts .Plaintext , []byte ("\n " ))
8894 for _ , line := range lines {
8995 if len (line ) == 0 {
You can’t perform that action at this time.
0 commit comments