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: made bin/setup always run from the desired path #129

Merged
merged 1 commit into from
Dec 4, 2019

Conversation

rosshadden
Copy link
Contributor

Impact: major
Type: bugfix

Issue

The general problem is that the find used in bin/setup is run from the PWD the script is run from.
The expected outcome is that bin/setup should only copy environment variables found within this project.

Right now running make init in reaction-platform copies the environment variables from every project's .env.example files into almost every .env file of every other project.
This is because in this case the find command used to find all .env.example files is being run from the platform directory, and thus all cloned projects within it are found by the find.

Solution

I made bin/setup cd to the root of the project before running the find.
This also prevents us from needing the $__dir variable we were using when referring to files within the script.

Testing

  1. Run bin/setup from the root of this project (which is the only place it used to work from).
  2. Run bin/setup from any other folder, such as reaction-platform or a folder that contains other reaction projects.

For both of these cases, verify that your working directory does not change. It shouldn't, because the cd happens within a function and is not expected to affect your shell directory.

Signed-off-by: Ross Hadden <rosshadden@gmail.com>
Copy link
Contributor

@focusaurus focusaurus left a comment

Choose a reason for hiding this comment

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

Ouch. Good find and fix.

@rosshadden rosshadden merged commit b2feafe into trunk Dec 4, 2019
@rosshadden rosshadden deleted the fix-bin-setup branch December 4, 2019 23:06
@kieckhafer kieckhafer mentioned this pull request Feb 6, 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