mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-19 09:24:51 +00:00
feature(win) add convertPath
This commit is contained in:
parent
2ddc818819
commit
bbf81a756a
1 changed files with 18 additions and 1 deletions
|
|
@ -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 = [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue