Skip to content

Commit

Permalink
Ignore hidden files in precompile and build
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesdemers authored and ryanflorence committed Feb 17, 2013
1 parent 24ec94f commit 4a69c43
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
14 changes: 8 additions & 6 deletions src/commands/build.js
Expand Up @@ -23,12 +23,14 @@ function createIndex() {
var dirPath = rootify(dirName); var dirPath = rootify(dirName);
var walker = walk(dirPath); var walker = walk(dirPath);
walker.on('file', function(dir, stats, next) { walker.on('file', function(dir, stats, next) {
var path = unroot(dir + '/' + stats.name).replace(/\.js$/, ''); if (stats.name.charAt(0) !== '.') {
var name = inflector.objectify(path.replace(dirName, '')); var path = unroot(dir + '/' + stats.name).replace(/\.js$/, '');
modules.push({ var name = inflector.objectify(path.replace(dirName, ''));
objectName: name, modules.push({
path: path objectName: name,
}); path: path
});
}
next(); next();
}); });
}); });
Expand Down
14 changes: 8 additions & 6 deletions src/commands/precompile.js
Expand Up @@ -41,12 +41,14 @@ function getTemplates(source, callback) {
var walker = walk(source); var walker = walk(source);


walker.on('file', function(dir, stats, next) { walker.on('file', function(dir, stats, next) {
var path = dir + '/' + stats.name; if (stats.name.charAt(0) !== '.') {
var name = path.replace(/\.handlebars$/, '').replace(source + '/', ''); var path = dir + '/' + stats.name;
templates.push({ var name = path.replace(/\.handlebars$/, '').replace(source + '/', '');
name: name, templates.push({
content: fs.readFileSync(path).toString() name: name,
}); content: fs.readFileSync(path).toString()
});
}
next(); next();
}); });


Expand Down

0 comments on commit 4a69c43

Please sign in to comment.