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

Handle absolute paths in REACT_SERVER_CONFIGS #901

Merged
merged 1 commit into from
Mar 21, 2017

Conversation

gigabo
Copy link
Contributor

@gigabo gigabo commented Mar 21, 2017

Looks like #871 introduced a regression where absolute paths are no longer
supported in the REACT_SERVER_CONFIGS environment variable.

This can be addressed by using path.resolve:

> path.resolve("/home/foo", "bar/baz", "config");
'/home/foo/bar/baz/config'
> path.resolve("/home/foo", "/bar/baz", "config");
'/bar/baz/config'

In place of path.join:

> path.join("/home/foo", "bar/baz", "config");
'/home/foo/bar/baz/config'
> path.join("/home/foo", "/bar/baz", "config");
'/home/foo/bar/baz/config'

I also removed the path concatenation (... + "/config").

Looks like redfin#871 introduced a regression where absolute paths are no longer
supported in the `REACT_SERVER_CONFIGS` environment variable.

This can be addressed by using `path.resolve`:
```js
> path.resolve("/home/foo", "bar/baz", "config");
'/home/foo/bar/baz/config'
> path.resolve("/home/foo", "/bar/baz", "config");
'/bar/baz/config'
```

In place of `path.join`:
```js
> path.join("/home/foo", "bar/baz", "config");
'/home/foo/bar/baz/config'
> path.join("/home/foo", "/bar/baz", "config");
'/home/foo/bar/baz/config'
```

I also removed the path concatenation (`... + "/config"`).
@gigabo gigabo added the bug An issue with the system label Mar 21, 2017
@gigabo gigabo merged commit 0381911 into redfin:master Mar 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue with the system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants