Skip to content

Commit

Permalink
Fixed example and command.
Browse files Browse the repository at this point in the history
  • Loading branch information
yawn committed Feb 18, 2016
1 parent c83baed commit 455b6a6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
23 changes: 22 additions & 1 deletion bin/es.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,28 @@ func main() {

}, Run: func(cmd *cobra.Command, args []string) {

for _, e := range h.Encrypt(envmap.ToMap(args)) {
var env = envmap.Import()

for k, _ := range env {

found := false

for _, e := range args {

if k == e {
found = true
break
}

}

if !found {
delete(env, k)
}

}

for _, e := range h.Encrypt(env) {
fmt.Println(e)
}

Expand Down
4 changes: 2 additions & 2 deletions example/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
BINARY=../build/darwin_amd64/es-bin
BINARY=../build/darwin-amd64/es

export SECRET1=opensesame
export SECRET2=foreyesonly
Expand All @@ -10,4 +10,4 @@ unset SECRET2

eval $(cat test.envs)

$BINARY dec -- /usr/local/bin/ep -v test.config -- /bin/cat test.config
$BINARY dec -- /usr/local/bin/ep -v -d test.config -- /bin/cat test.config

0 comments on commit 455b6a6

Please sign in to comment.