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.rootPath and Meteor.absolutePath are the same on Windows #3
Comments
Would you run tests and send PR? Otherwise I can do it myself, but later |
I updated the issue description. |
Ok, I`ll try to make a PR. |
@Konard Meteor.absolutePath = __meteor_bootstrap__.serverDir.split(/(\\|\/).meteor/)[0]; |
For me it looks like the best solution is: var path = Npm.require('path');
Meteor.absolutePath = path.resolve('.').split(path.sep + '.meteor')[0];
But |
isn't |
Trying to run |
In project's directory run:
|
This is what I get. No output in console. |
First visit |
I actually cannot do it. I have only access to ssh. And to 8080, 8081, 8082 ports from the internet. |
Ah. |
I see you've solved it |
This code have the same results as current version (https://github.com/VeliovGroup/Meteor-root/blob/c2978b2dd76248156aef97541905e11fa1ed1fcf/meteor-root.js): var path = Npm.require('path');
Meteor.rootPath = path.resolve('.');
Meteor.absolutePath = Meteor.rootPath.split(path.sep + '.meteor')[0]; And the only changes required are these 3 lines. It works on windows too (tested). |
Published as v1.0.3, also available via Atmosphere. Thank you for contribution @Konard Sorry for off-topic, but I saw you has knowledge in Traditional Chinese, if it's true, let me know if you're interested in translating interfaces, we're looking for help with next languages:
And preferred way and time to contact you. |
@dr-dimitru contact me direclty using vk or skype on this topic please. |
Both
Meteor.rootPath
andMeteor.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. Andsplit('/.meteor')
no longer finds any'/.meteor'
in resulting path.So it is better to use
path.sep
inpath.sep + '.meteor'
as the result argument forsplit
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
or
Looks like
__meteor_bootstrap__.serverDir
is equal topath.resolve('.')
andprocess.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
The text was updated successfully, but these errors were encountered: