Skip to content

Commit c2978b2

Browse files
committed
v1.0.2
- Get rid of `fs-extra` dependency - Add `Meteor.absolutePath`
1 parent cbbf3bf commit c2978b2

File tree

5 files changed

+67
-9
lines changed

5 files changed

+67
-9
lines changed

README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,9 @@ Usage:
1313
```javascript
1414
var pathToFile = Meteor.rootPath + '/folder/where/is/your/file.json';
1515
```
16-
Returns absolute path to `programs/server` folder of your compiled application
16+
Returns absolute path to `programs/server` folder of your compiled application, without trailing slash
17+
18+
```javascript
19+
var pathToFile = Meteor.absolutePath + '/.meteor/local/build/programs/server/folder/where/is/your/file.json';
20+
```
21+
Returns absolute path to `.meteor` folder of your compiled application, without trailing slash

meteor-root-test.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Tinytest.add('Meteor.rootPath (see console for path)', function(test){
2+
console.log('Meteor.rootPath is: ');
3+
console.log(Meteor.rootPath);
4+
});
5+
6+
Tinytest.add('Meteor.absolutePath (see console for path)', function(test){
7+
console.log('Meteor.absolutePath is: ');
8+
console.log(Meteor.absolutePath);
9+
});

meteor-root.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
var fs = Npm.require('fs-extra');
2-
Meteor.rootPath = fs.realpathSync('.');
1+
Meteor.rootPath = __meteor_bootstrap__.serverDir;
2+
Meteor.absolutePath = __meteor_bootstrap__.serverDir.split('/.meteor')[0];

package.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package.describe({
22
name: 'ostrio:meteor-root',
3-
version: '1.0.0',
3+
version: '1.0.2',
44
summary: '[Server] Get current path on your server, where is Meteor application is running',
55
git: 'https://github.com/VeliovGroup/Meteor-root',
66
documentation: 'README.md'
@@ -11,6 +11,7 @@ Package.onUse(function(api) {
1111
api.addFiles('meteor-root.js', 'server');
1212
});
1313

14-
Npm.depends({
15-
'fs-extra': '0.16.3'
14+
Package.onTest(function(api) {
15+
api.use(['ostrio:[email protected]', 'tinytest'], 'server');
16+
api.addFiles('meteor-root-test.js', 'server');
1617
});

0 commit comments

Comments
 (0)