Code Monkey home page Code Monkey logo

meteor-root's People

Contributors

dr-dimitru avatar konard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

meteor-root's Issues

Path vars switched

Hi! I think the documentation is missing the value of the correct vars. Here is what I get from root and absolute paths:

Absolute Path: /home/user/Meteor/app
Root Path: /home/user/Meteor/app/.meteor/local/build/programs/server

Wrong path returned

In order to get the project path, the following should be added

.split('.meteor')[0];

actually, the proper way to get this info with M1.2.1 is

__meteor_bootstrap__.serverDir.split('.meteor')[0]

Wrong path in test-mode

Doesn't work in test-mode ... It always returns a path like /private/var/folders/qb/j_vlz31s2wn7v0vn7jhz5bvc0000gn/T/meteor-test-runowob50.z6tz - at least on my Mac OS X using Meteor v1.6.0.1

Meteor.rootPath and Meteor.absolutePath are the same on Windows

Both Meteor.rootPath and Meteor.absolutePath returns full path to 'programs/server' on Windows (meteor 1.2.1).

This is because final paths on Windows use \\ instead of / for folder separator. And split('/.meteor') no longer finds any '/.meteor' in resulting path.

So it is better to use path.sep in path.sep + '.meteor' as the result argument for split function.

So the possible solution is to change:

Meteor.absolutePath = __meteor_bootstrap__.serverDir.split('/.meteor')[0]; (https://github.com/VeliovGroup/Meteor-root/blob/c2978b2dd76248156aef97541905e11fa1ed1fcf/meteor-root.js#L2)

to

var path = Npm.require('path');
Meteor.absolutePath = __meteor_bootstrap__.serverDir.split(path.sep + '.meteor')[0];

or

var path = Npm.require('path');
Meteor.absolutePath = path.resolve('.').split(path.sep + '.meteor')[0];

Looks like __meteor_bootstrap__.serverDir is equal to path.resolve('.') and process.cwd().

More at: http://stackoverflow.com/questions/18378809/find-absolute-base-path-of-the-project-directory-after-meteor-0-6-5/35948996#35948996
And: http://stackoverflow.com/questions/18378809/find-absolute-base-path-of-the-project-directory-after-meteor-0-6-5/35948996#comment59967680_32658007

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.