From ba342d571e1e25c8f1655ec208c8125c3cba7eba Mon Sep 17 00:00:00 2001 From: Keerthi Niranjan Date: Thu, 15 Feb 2018 11:06:49 +0530 Subject: [PATCH] SEARCH-605 - Permission error on windows 7 temporary fix --- js/search/utils/checkDiskSpace.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/js/search/utils/checkDiskSpace.js b/js/search/utils/checkDiskSpace.js index f8d1c729..85dc6c98 100644 --- a/js/search/utils/checkDiskSpace.js +++ b/js/search/utils/checkDiskSpace.js @@ -25,13 +25,21 @@ function checkDiskSpace(path, resolve, reject) { return resolve(space >= searchConfig.MINIMUM_DISK_SPACE); }); } else { - exec(`fsutil volume diskfree ${path}`, (error, stdout, stderr) => { + exec(`fsutil volume diskfree ${path}`, (error, stdout) => { if (error) { - if (stderr.indexOf("No such file or directory") !== -1) { + if (stdout.indexOf("Error: The system cannot find the path specified.") !== -1) { return reject(new Error("No such file or directory : " + error)); } + if (stdout.indexOf("The FSUTIL utility requires that you have administrative privileges.") !== -1) { + // this is temporary until we use the custom exe file. + return true; + } return reject(new Error("Error : " + error)); } + if (stdout.indexOf("The FSUTIL utility requires that you have administrative privileges.") !== -1) { + // this is temporary until we use the custom exe file. + return true; + } let data = stdout.trim().split("\n"); let disk_info_str = data[data.length - 1].split(':');