[Pkg-javascript-commits] [node-module-deps] 65/444: isFIFO

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 15 09:47:43 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 3081d8e1de626ca27440f80a5993a9025726a18a
Author: James Halliday <mail at substack.net>
Date:   Sun Mar 31 23:40:43 2013 -0700

    isFIFO
---
 index.js | 26 +++++++++++++++++++-------
 1 file changed, 19 insertions(+), 7 deletions(-)

diff --git a/index.js b/index.js
index 3f3865c..d2d06f6 100644
--- a/index.js
+++ b/index.js
@@ -99,12 +99,12 @@ module.exports = function (mains, opts) {
     }
     
     function parseDeps (file, src) {
-        var deps;
-        try {
-            deps = detective(src);
-        } catch (ex) {
+        try { var deps = detective(src) }
+        catch (ex) {
             var message = ex && ex.message ? ex.message : ex;
-            return output.emit('error', new Error('Parsing file ' + file + ': ' + message));
+            return output.emit('error', new Error(
+                'Parsing file ' + file + ': ' + message
+            ));
         }
         var p = deps.length;
         var current = { id: file, filename: file, paths: [] };
@@ -136,8 +136,20 @@ module.exports = function (mains, opts) {
         if (typeof tr === 'function') return cb(null, tr(file));
         
         var params = { basedir: path.dirname(file) };
-        nodeResolve(tr, params, function (err, res) {
-            if (err) return cb(err)
+        nodeResolve(tr, params, function nr (err, res, again) {
+            if (err && again) return cb(err);
+            
+            if (err) {
+                return fs.stat(file, function (err_, s) {
+                    if (err_) return cb(err_);
+                    if (!s.isFIFO()) return cb(err);
+                    
+                    params.basedir = process.cwd();
+                    nodeResolve(tr, params, function (e, r) {
+                        nr(e, r, true)
+                    });
+                });
+            }
             
             if (!res) return cb(new Error([
                 'cannot find transform module ', tr,

-- 
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