Permalink
Browse files

Added Template#files

  • Loading branch information...
1 parent 61fa39e commit 94782cc19a78d503116bc5463cc10da33df992fb @tj committed Mar 4, 2011
Showing with 23 additions and 1 deletion.
  1. +23 −1 bin/ngen
View
24 bin/ngen
@@ -94,13 +94,35 @@ Template.prototype.init = function(dest){
};
/**
+ * Return the files for this template.
+ *
+ * @return {Array}
+ * @api private
+ */
+
+Template.prototype.__defineGetter__('files', function(){
+ var files = [];
+
+ (function next(dir) {
+ fs.readdirSync(dir).forEach(function(file){
+ files.push(file = dir + '/' + file);
+ var stat = fs.statSync(file);
+ if (stat.isDirectory()) next(file);
+ });
+ })(this.path);
+
+ return files;
+});
+
+
+/**
* Create the template files.
*
* @api private
*/
Template.prototype.create = function(){
-
+ console.log(this.files);
};
/**

0 comments on commit 94782cc

Please sign in to comment.