Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bin/setup handling bad env.example #5048

Merged
merged 1 commit into from
Mar 18, 2019

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.

3 participants