From 51a46c0666e116fabb54d64fc868e85bef4220e7 Mon Sep 17 00:00:00 2001 From: Thomas Holloway Date: Thu, 7 Jul 2016 23:58:17 -0500 Subject: [PATCH 1/2] Update package.json --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index d52329c..5e5dd8b 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,8 @@ }, "os": [ "linux", - "win32" + "win32", + "darwin" ], "devDependencies": { } From d6e9191acb512ce024e9b9a3cee7eba018f7616a Mon Sep 17 00:00:00 2001 From: Gavin Aiken Date: Thu, 23 Feb 2017 12:52:30 +0000 Subject: [PATCH 2/2] Move array variable inside function so it does not grow with each call to getDrives --- lib/diskinfo.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/diskinfo.js b/lib/diskinfo.js index 3816565..d372043 100644 --- a/lib/diskinfo.js +++ b/lib/diskinfo.js @@ -9,7 +9,6 @@ var exec = require('child_process').exec; var os = require('os'); -var aDrives = []; /** * Returns an array of drives or calls callback @@ -18,6 +17,7 @@ var aDrives = []; * the array of drives, set null if no callback */ exports.getDrives = function(callback) { + var aDrives = []; switch (os.platform().toLowerCase()) { case 'win32': diff --git a/package.json b/package.json index d52329c..46c2d15 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "author": "Benoit Gauthier", "name": "diskinfo", "description": "Nodejs module to get drive information, tested on linux centos and windows vista", - "version": "0.0.3", + "version": "0.0.4", "license": "MIT", "main": "./lib/diskinfo.js", "scripts": {