Skip to content

feat: validate .env in init#199

Merged
shumkov merged 2 commits into
dashpay:testnet-preparationsfrom
strophy:fix-envfile-2
Dec 21, 2020
Merged

feat: validate .env in init#199
shumkov merged 2 commits into
dashpay:testnet-preparationsfrom
strophy:fix-envfile-2

Conversation

@strophy
Copy link
Copy Markdown
Collaborator

@strophy strophy commented Dec 18, 2020

Checking for presence of the .env and loading its content was previously done in two places: in the dash-network command wrapper and in the generate command. This PR removes the duplicate code and moves the check into the init function.

Issue being fixed or feature implemented

This fixes the chicken/egg problem of not having an .env file and not being able to create one because init.sh checks for its existence first, and also the problem of overwriting existing .env files when running generate.

What was done?

Remove .env forced exit in dash-network and check/generate in init.sh instead of in the generate command.

How Has This Been Tested?

Tested running bin/generate from shell and dash-network generate with docker.

Breaking Changes

None

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

Copy link
Copy Markdown
Collaborator

@shumkov shumkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job! 👍

@shumkov shumkov merged commit c5ba397 into dashpay:testnet-preparations Dec 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants