Skip to content

Commit

Permalink
Merge pull request #2 from Droplr/feat-enable-whitespaces-1
Browse files Browse the repository at this point in the history
Approach to handling whitespaces
  • Loading branch information
orfin authored Jul 17, 2017
2 parents a9c9510 + 7647c34 commit 03f949a
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ $ wget https://github.com/Droplr/aws-env/raw/master/bin/aws-env-linux-amd64 -O a
* `AWS_ENV_PATH` - path of parameters. If it won't be provided, aws-env will exit immediately. That way, you can run your Dockerfiles locally.
* `AWS_REGION` and AWS Credentials - [configuring credentials](https://github.com/aws/aws-sdk-go#configuring-credentials)
```
$ `AWS_ENV_PATH=/prod/my-app/ AWS_REGION=us-west-2 ./aws-env` && npm run
$ eval $(AWS_ENV_PATH=/prod/my-app/ AWS_REGION=us-west-2 ./aws-env) && node -e "console.log(process.env)"
```


Expand All @@ -45,7 +45,7 @@ RUN apk update && apk upgrade && \
RUN wget https://github.com/Droplr/aws-env/raw/master/bin/aws-env-linux-amd64 -O /bin/aws-env && \
chmod +x /bin/aws-env
CMD `aws-env` && node -e "console.log(process.env)"
CMD eval $(aws-env) && node -e "console.log(process.env)"
```

```
Expand Down
3 changes: 2 additions & 1 deletion aws-env.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func PrintExportParameter(path string, parameter *ssm.Parameter) {
value := *parameter.Value

env := strings.Trim(name[len(path):], "/")
value = strings.Replace(value, "\n", "\\n", -1)

fmt.Printf("export %s=%s \n", env, value)
fmt.Printf("export %s=$'%s'\n", env, value)
}
Binary file modified bin/aws-env-darwin-386
Binary file not shown.
Binary file modified bin/aws-env-darwin-amd64
Binary file not shown.
Binary file modified bin/aws-env-linux-386
Binary file not shown.
Binary file modified bin/aws-env-linux-amd64
Binary file not shown.
Binary file modified bin/aws-env-windows-386
Binary file not shown.
Binary file modified bin/aws-env-windows-amd64
Binary file not shown.

0 comments on commit 03f949a

Please sign in to comment.