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

load path #2

Closed
charleshross opened this issue May 10, 2014 · 5 comments
Closed

load path #2

charleshross opened this issue May 10, 2014 · 5 comments

Comments

@charleshross
Copy link

to go up a folder and then into a folder I have to do this:
var site = loader.load(__dirname + "/../routes");

This is non-standard tho, usually this should be fine:
var site = loader.load("../routes");

Are you able to implement this behavior? I find it odd and verbose that I have to use "__dirname" otherwise I need to put the full path.

@jwerle
Copy link
Owner

jwerle commented May 10, 2014

@charleshross There is no easy way to determine the relative directory :( The path returned from process.cwd() is relative to where you invoked thenode(1) and passing "../routes" to loader.load() leads to an undetermined path because the method has no idea of the path relative to the module invoking it.

@jwerle
Copy link
Owner

jwerle commented May 10, 2014

If you can think of a solution I'd happily accept a PR

@jwerle jwerle closed this as completed May 10, 2014
@jwerle jwerle reopened this May 10, 2014
@jwerle jwerle closed this as completed in 2dcb705 May 10, 2014
@jwerle
Copy link
Owner

jwerle commented May 10, 2014

@charleshross I added a small patch/hack to get working what you want. Let me know if you have any issues

@charleshross
Copy link
Author

Oh wow, thank you man I'll test it out today!

@jwerle
Copy link
Owner

jwerle commented May 12, 2014

thanks !

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

No branches or pull requests

2 participants