diff options
Diffstat (limited to 'lib/models')
-rw-r--r-- | lib/models/fs.js | 7 | ||||
-rw-r--r-- | lib/models/page.js | 9 |
2 files changed, 10 insertions, 6 deletions
diff --git a/lib/models/fs.js b/lib/models/fs.js index 2400ff2..c74f3cd 100644 --- a/lib/models/fs.js +++ b/lib/models/fs.js @@ -182,7 +182,7 @@ FS.prototype.listAllFiles = function(folder) { var isDirectory = pathIsFolder(file); if (!isDirectory) { - return out.push(file); + return out.push(path.join(folder, file)); } return that.listAllFiles(path.join(folder, file)) @@ -190,11 +190,6 @@ FS.prototype.listAllFiles = function(folder) { return out.concat(inner); }); }, Immutable.List()); - }) - .then(function(files) { - return files.map(function(file) { - return path.join(folder, file); - }); }); }; diff --git a/lib/models/page.js b/lib/models/page.js index 0a9cf38..ffb9601 100644 --- a/lib/models/page.js +++ b/lib/models/page.js @@ -32,6 +32,15 @@ Page.prototype.getDir = function() { }; /** + Return path of the page + + @return {String} +*/ +Page.prototype.getPath = function() { + return this.getFile().getPath(); +}; + +/** Create a page for a file @param {File} file |