fs-jetpack
Advanced tools
Comparing version 0.5.0 to 0.5.1
@@ -27,14 +27,11 @@ // The main thing. Here everything starts. | ||
var cwd = function (newCwdPath) { | ||
// return current CWD if no parameter... | ||
if (newCwdPath === undefined) { | ||
var cwd = function () { | ||
// return current CWD if no arguments specified... | ||
if (arguments.length === 0) { | ||
return getCwdPath(); | ||
} | ||
// ...create new CWD context otherwise | ||
if (typeof newCwdPath === 'string') { | ||
newCwdPath = pathUtil.resolve(getCwdPath(), newCwdPath); | ||
} else { | ||
newCwdPath = null; | ||
} | ||
return jetpackContext(newCwdPath); | ||
var args = Array.prototype.slice.call(arguments); | ||
var pathParts = [getCwdPath()].concat(args); | ||
return jetpackContext(pathUtil.resolve.apply(null, pathParts)); | ||
} | ||
@@ -41,0 +38,0 @@ |
{ | ||
"name": "fs-jetpack", | ||
"description": "Higher level API for 'fs' library", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"author": "Jakub Szwacz <jakub@szwacz.com>", | ||
@@ -6,0 +6,0 @@ "dependencies": { |
@@ -32,2 +32,7 @@ "use strict"; | ||
it('cwd can join path parts', function () { | ||
var jetCwd = jetpack.cwd('a', 'b', 'c'); | ||
expect(jetCwd.cwd()).toBe(pathUtil.resolve(process.cwd(), 'a', 'b', 'c')); | ||
}); | ||
}); |
170465
3849