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 inability to use symlinked config with relative includes #42

Merged
merged 1 commit into from
Nov 17, 2015

Conversation

shayne
Copy link
Contributor

@shayne shayne commented Oct 28, 2015

My Phoenix config is symlinked to ~/.phoenix.js from my dotfiles
directory. This PR adds support for relative requires whether or not
you're using a symlinked config file, it also maintains support for
absoltue path includes (e.g. require('~/jslibs/some-file.js')).

@shayne shayne force-pushed the 2.0-require-symlinks branch from 7895286 to 8b2f6bf Compare October 28, 2015 18:28
@@ -136,10 +136,17 @@ - (void) setupAPI {
self.context[@"Mouse"] = [PHMouse class];
self.context[@"App"] = [PHApp class];
self.context[@"Window"] = [PHWindow class];

Copy link
Owner

Choose a reason for hiding this comment

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

Redundant white spaces.

@shayne shayne force-pushed the 2.0-require-symlinks branch from 8b2f6bf to 51a2285 Compare October 29, 2015 01:24
@shayne
Copy link
Contributor Author

shayne commented Oct 29, 2015

stringByResolvingSymlinksInPath does the same thing as stringByStandardizingPath + resolve symlinks, of course.

Tested with a ~/phoenix-debug.js of:

require('./libs/test.js');
require('~/root-test.js');

My Phoenix config is symlinked to `~/.phoenix.js` from my dotfiles
directory. This PR adds support for relative requires whether or not
you're using a symlinked config file, it also maintains support for
absoltue path includes (e.g. `require('~/jslibs/some-file.js')`).
@shayne shayne force-pushed the 2.0-require-symlinks branch from 51a2285 to a72469b Compare October 29, 2015 02:01
@kasper
Copy link
Owner

kasper commented Nov 17, 2015

@shayne Now that is a clean fix! Sorry for the wait. Indeed stringByStandardizingPath only resolves symlinks in absolute paths.

kasper added a commit that referenced this pull request Nov 17, 2015
Fix inability to use symlinked configuration with relative includes
@kasper kasper merged commit 521bf3d into kasper:2.0 Nov 17, 2015
@kasper kasper added this to the 2.0 milestone Nov 17, 2015
@kasper kasper self-assigned this Nov 17, 2015
@shayne shayne deleted the 2.0-require-symlinks branch November 18, 2015 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants