[Pkg-javascript-commits] [node-module-deps] 425/444: fix for undefined dirnames
Bastien Roucariès
rouca at moszumanska.debian.org
Fri Dec 15 09:48:20 UTC 2017
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to branch master
in repository node-module-deps.
commit da67951cab59d785a26c04aa3b5f3e1dcc529b43
Author: substack <substack at 9nTgtYmvW4HID6ayt6Icwc8WZxdifx5SlSKKIX/X/1g=.ed25519>
Date: Sat Oct 22 14:49:08 2016 -0400
fix for undefined dirnames
---
index.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/index.js b/index.js
index 963e214..6684064 100644
--- a/index.js
+++ b/index.js
@@ -135,7 +135,7 @@ Deps.prototype._flush = function () {
Object.keys(files).forEach(function (key) {
var r = files[key];
var pkg = r.pkg || {};
- var dir = path.dirname(r.row.file);
+ var dir = r.row.file ? path.dirname(r.row.file) : self.basedir;
if (!pkg.__dirname) pkg.__dirname = dir;
self.walk(r.row, xtend(self.top, {
filename: path.join(dir, '_fake.js')
@@ -466,7 +466,7 @@ Deps.prototype.lookupPackage = function (file, cb) {
if (cached) return nextTick(cb, null, cached);
if (cached === false) return nextTick(cb, null, undefined);
- var dirs = parents(path.dirname(file));
+ var dirs = parents(file ? path.dirname(file) : self.basedir);
(function next () {
if (dirs.length === 0) {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-module-deps.git
More information about the Pkg-javascript-commits
mailing list