From c4f1b8ce35f368a4d06cd98d5054b0673394f2fa Mon Sep 17 00:00:00 2001 From: Max Goldman Date: Mon, 16 Jan 2017 11:52:20 -0500 Subject: [PATCH] Order revisions by build directory time, not build file time Helps with #8. See also #46. --- src/builder.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/builder.js b/src/builder.js index 7b02060..637107d 100644 --- a/src/builder.js +++ b/src/builder.js @@ -88,7 +88,8 @@ exports.findBuilds = function(spec, callback) { return; } let revs = files.map(function(file) { - return { rev: file.split(path.sep)[0], ctime: fs.statSync(path.join(dir, file)).ctime.getTime() }; + let rev = file.split(path.sep)[0]; + return { rev, ctime: fs.statSync(path.join(dir, rev)).ctime.getTime() }; }).sort(function(a, b) { return b.ctime - a.ctime; }).map(function(data) {