|
|
@ -28,9 +28,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
//Adapted from http://stackoverflow.com/questions/5827612/node-js-fs-readdir-recursive-directory-search
|
|
|
|
//Adapted from http://stackoverflow.com/questions/5827612/node-js-fs-readdir-recursive-directory-search
|
|
|
|
walk: function(dir, done) {
|
|
|
|
walk: function(dir, done) {
|
|
|
|
var results = [],
|
|
|
|
var results = [];
|
|
|
|
path = require('path'),
|
|
|
|
|
|
|
|
main_dir = path.join(__dirname, '..', 'templates');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fs.readdir(dir, function(err, list) {
|
|
|
|
fs.readdir(dir, function(err, list) {
|
|
|
|
if (err) {
|
|
|
|
if (err) {
|
|
|
@ -51,7 +49,7 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
results.push(file.replace(main_dir + '/', '').replace('.tpl', ''));
|
|
|
|
results.push(file);
|
|
|
|
if (!--pending) {
|
|
|
|
if (!--pending) {
|
|
|
|
done(null, results);
|
|
|
|
done(null, results);
|
|
|
|
}
|
|
|
|
}
|
|
|
|