Issue with traverse in multiple modules. #20

Closed
mcanas opened this Issue Feb 12, 2013 · 1 comment

Comments

Projects
None yet
2 participants

mcanas commented Feb 12, 2013

I am running into an issue using kss.traverse() in multiple modules. Based on the following setup:

/app.js

var styles = require('./routes/styles');
var scripts = require('./routes/scripts');

styles.getStyles();
scripts.getScripts();

/routes/scripts.js

var kss = require('kss')
options = {
  markdown: false,
  masks: '*.css'
};

exports.getScripts = function() {
  kss.traverse('public/javascripts', options, function(err, guide) {
    if(err) throw err;
    console.log('scripts:',err,guide.data.files);
  });
};

/routes/styles.js

var kss = require('kss')
options = {
  markdown: false,
  masks: '*.css'
};

exports.getStyles = function() {
  kss.traverse('public/stylesheets', options, function(err, guide) {
    if(err) throw err;
    console.log('styles:',err,guide.data.files);
  });
};

Assume also that the following files exist:
/public/javascripts/scripts.css
/public/stylesheets/styles.css

This produces the following response in the log:

scripts: false [ 'public/javascripts/scripts.css' ]

What I should be seeing is a response of both 'scripts: ...' and 'styles: ...', but I only see one. The behavior is that the last method to be called in app.js is the one that gets a response. One traverse call seems to be interfering with the other.

Is this a bug or am I missing something?

Contributor

JohnAlbin commented Apr 18, 2014

I can confirm the results posted here. @mcanas Did you ever figure out what the issue was?

@JohnAlbin JohnAlbin closed this in 684e968 Jul 18, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment