From bbf81a756ae870f9a4dc77e7696592b74391d4bd Mon Sep 17 00:00:00 2001 From: coderaiser Date: Sat, 21 Jun 2014 17:51:38 +0300 Subject: [PATCH] feature(win) add convertPath --- lib/server/win.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/lib/server/win.js b/lib/server/win.js index 66aca1f4..2f58a4cf 100644 --- a/lib/server/win.js +++ b/lib/server/win.js @@ -19,7 +19,24 @@ processExec = main.child_process.exec, Util = main.util; - exports.getVolumes = function(callback) { + exports.convertPath = convertPath; + exports.getVolumes = getVolumes; + + function convertPath(path) { + var volume; + + Util.checkArgs(arguments, ['path']); + + if (path !== '/') { + volume = path[1]; + path = path.split('').slice(2); + path = volume + ':' + path; + } + + return path; + } + + function getVolumes(callback) { processExec('wmic logicaldisk get name', function(error, stdout, stderr) { var volumes = [], removeStr = [