refactoring installation scripts to use node prompt module, lots of other fixes

fixed #263, fixed #264, fixed #265
This commit is contained in:
Julian Lam
2013-09-06 22:22:42 -04:00
parent a88ddc2a4d
commit bec0b46a2c
11 changed files with 216 additions and 173 deletions

View File

@@ -17,8 +17,8 @@
//Adapted from http://stackoverflow.com/questions/5827612/node-js-fs-readdir-recursive-directory-search
walk: function(dir, done) {
var main_dir = global.configuration.ROOT_DIRECTORY + '/public/templates/';
var results = [];
var results = [],
templateExtract = /\/([\w\d\-_]+)\.tpl$/;
fs.readdir(dir, function(err, list) {
if (err) return done(err);
var pending = list.length;
@@ -32,7 +32,10 @@
if (!--pending) done(null, results);
});
} else {
results.push(file.replace(main_dir, '').replace('.tpl', ''));
var templateMatch = file.match(templateExtract);
if (templateMatch) results.push(templateMatch[1]);
// results.push(file.replace(main_dir, '').replace('.tpl', ''));
if (!--pending) done(null, results);
}
});