feature(win) add convertPath

This commit is contained in:
coderaiser 2014-06-21 17:51:38 +03:00
parent 2ddc818819
commit bbf81a756a

View file

@ -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 = [