From 827f1e614a7f1597478b285e0899f7ba4dac9fc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Dahlgren?= Date: Mon, 30 May 2022 22:48:43 +0200 Subject: [PATCH] Update async library to 2.x --- lib/logs.js | 12 ++++++++++-- package.json | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/logs.js b/lib/logs.js index cc9b2f5..3a89e63 100644 --- a/lib/logs.js +++ b/lib/logs.js @@ -97,13 +97,21 @@ Logs.prototype.logFiles = function (callback) { async.filter(files, function (file, cb) { fs.stat(file.path, function (err, stat) { + if (err) { + return cb(err) + } + file.created = stat.birthtime.toISOString() file.modified = stat.mtime.toISOString() file.formattedSize = filesize(stat.size) file.size = stat.size - cb(!err && stat.isFile()) + cb(null, stat.isFile()) }) - }, function (files) { + }, function (err, files) { + if (err) { + return callback(err) + } + files.sort(function (a, b) { return b.created.localeCompare(a.created) // Descending order }) diff --git a/package.json b/package.json index 7b64b46..2e8ccb7 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "dependencies": { "arma-class-parser": "^1.1.1", "arma-server": "0.0.10", - "async": "^0.9.0", + "async": "^2.6.4", "backbone": "1.3.3", "backbone.bootstrap-modal": "https://github.com/powmedia/backbone.bootstrap-modal/archive/632210077c2424be2ee6ea2aafe0d3fe016ae524.tar.gz", "backbone.marionette": "2.4.7",