Skip to content

Commit

Permalink
Use sh instead of bash
Browse files Browse the repository at this point in the history
  • Loading branch information
pratishshr committed Jun 10, 2020
1 parent 0172c5e commit bc15975
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ Instead of setting up a `~/.aws/credentials` file. You can also use the followin
| AWS_SECRET_ACCESS_KEY | Your AWS secret key|
| AWS_REGION | AWS region where you added your secret|
| ENVIRONMENT | Environment which you set in envault.json |
| SECRET_NAME | AWS Secret Name |


### 8. Using custom .env files
Expand Down
2 changes: 1 addition & 1 deletion envault.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
func main() {
info := &cli.Info{
Name: "Envault",
Version: "1.1.8",
Version: "1.1.9",
Description: "Envault is a simple CLI tool which runs a process with secrets from AWS Secrets Manager.",
AuthorName: "Pratish Shrestha",
AuthorEmail: "pratishshr@gmail.com",
Expand Down
4 changes: 4 additions & 0 deletions internal/secrets/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ func GetSecrets(secretName string, env string, region string, profile string, en
env = conf.DefaultEnvironment
}

if secretName == "" {
secretName = os.Getenv("SECRET_NAME")
}

if secretName == "" && env == "" {
exit.Error("Secret Name is required to list environments. Set -secret flag.")
}
Expand Down
2 changes: 1 addition & 1 deletion util/shell/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func convertToSlice(secrets map[string]string) []string {
func Execute(command string, secrets map[string]string) {
env := append(os.Environ(), convertToSlice(secrets)...)

cmd := exec.Command("bash", "-c", command)
cmd := exec.Command("sh", "-c", command)
cmd.Env = env
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
Expand Down

0 comments on commit bc15975

Please sign in to comment.