Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@focusaurus
Copy link
Contributor

Resolves #5047
Impact: minor
Type: **bugfix

Issue

A bunk .env.example file can cause the bin/setup script to abort without copying all the values into .env.

Solution

  • Only eval lines that contain a $ to handle dynamic env var expansion
  • Use a subshell to deal with exit codes and grep || true properly
  • Also sort the keys for consistency/determinism

Breaking changes

None

Testing

  1. Create a .env.example file anywhere under your reaction directory with the following line
  • EXAMPLE_VAR=docker.for.mac.localhost:<port>, add stuff: in networks: in docker-compose.yml
  1. Run ./bin/setup
  2. Check your .env for the EXAMPLE_VAR line

- Only eval if right hand side contains a $
- Use subshell around grep || true
- Sort keys

Signed-off-by: Peter Lyons <[email protected]>
@focusaurus focusaurus added the bug For issues that describe a defect or regression in the released software label Mar 18, 2019
@focusaurus focusaurus self-assigned this Mar 18, 2019
@focusaurus focusaurus merged commit 94a6236 into develop Mar 18, 2019
@focusaurus focusaurus deleted the fix-pete-setup-handling-bad-env.example branch March 18, 2019 19:18
@jeffcorpuz jeffcorpuz mentioned this pull request Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug For issues that describe a defect or regression in the released software

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants