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

Meteor get lost on apps created inside dir named as public. #352

Closed
rodrigopinto opened this Issue Sep 23, 2012 · 4 comments

Comments

Projects
None yet
2 participants
@rodrigopinto

rodrigopinto commented Sep 23, 2012

Hi guys,

When I create an app inside a directory name as public and I run meteor command I get a blank page on browser.

I tried to create an app inside a dir named public like this:

rodrigopinto@prometheus:~/code/github/public [ruby-1.9.2] $ meteor create cool-app 

rodrigopinto@prometheus:~/code/github/public [ruby-1.9.2] $ cd cool-app/

rodrigopinto@prometheus:~/code/github/public/cool-app [ruby-1.9.2] $ meteor

For futher information, I tried different path levels and always I create the app inside public dir I get this issue.

@glasser

This comment has been minimized.

Member

glasser commented Sep 23, 2012

You're right, this looks like a bug in pre_filter in app/lib/files.js where there's already an XXX comment. Probably not too hard to fix.

@rodrigopinto

This comment has been minimized.

rodrigopinto commented Sep 23, 2012

@glasser Sure. I've been replaced the code starting on line 41 of files.js until 45 by this code below, and it fixed this issue:

    // XXX
    // first, we only want to exclude APP_ROOT/public, not some deeper public
    // second, we don't really like this at all
    // third, we don't update the app now if anything here changes
    var appDirName = this.find_app_dir(filename)
    var stats = fs.lstatSync(filename);
    var appPublicDir = (filename.indexOf(appDirName+'/public') !== -1)

    if (stats.isDirectory() && appPublicDir) { return false; }

However, based on a search of meteor code I think I should use lstat(Assyncronous) instead of lstatSync. Is that correct?

Thx.

@glasser

This comment has been minimized.

Member

glasser commented Sep 24, 2012

I think we can get away with just checking in pre_filter to see if the path ends with /public.

BTW, it's fine to use sync calls in the meteor command-line tool (which is generally not acting as a server that has to use an event loop to deal with incoming requests).

@glasser glasser closed this in a0252d6 Sep 24, 2012

@rodrigopinto

This comment has been minimized.

rodrigopinto commented Sep 24, 2012

👍 Nice and clean!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment