diff options
-rw-r--r-- | src/library.js | 3 | ||||
-rw-r--r-- | src/library_path.js | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/library.js b/src/library.js index 5a363092..de743b31 100644 --- a/src/library.js +++ b/src/library.js @@ -180,6 +180,9 @@ LibraryManager.library = { // // paths // + cwd: function() { + return FS.currentPath; + }, lookupPath: function (path, opts) { path = PATH.resolve(FS.currentPath, path); opts = opts || { recurse_count: 0 }; diff --git a/src/library_path.js b/src/library_path.js index 3df6ca5b..feec1e68 100644 --- a/src/library_path.js +++ b/src/library_path.js @@ -1,4 +1,5 @@ mergeInto(LibraryManager.library, { + $PATH__deps: ['$FS'], $PATH: { // split a filename into [root, dir, basename, ext], unix version // 'root' is just a slash, or nothing. @@ -80,7 +81,7 @@ mergeInto(LibraryManager.library, { var resolvedPath = '', resolvedAbsolute = false; for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { - var path = (i >= 0) ? arguments[i] : process.cwd(); + var path = (i >= 0) ? arguments[i] : FS.cwd(); // Skip empty and invalid entries if (typeof path !== 'string') { throw new TypeError('Arguments to path.resolve must be strings'); |