fix unstage issues
Signed-off-by: Travis Glenn Hansen <travisghansen@yahoo.com>
This commit is contained in:
parent
7fd385d2d0
commit
a81246664b
|
|
@ -117,6 +117,10 @@ function stripWindowsDriveLetter(path) {
|
|||
return path.replace(/^[a-zA-Z]:/, "");
|
||||
}
|
||||
|
||||
function hasWindowsDriveLetter(path) {
|
||||
return /^[a-zA-Z]:/i.test(path);
|
||||
}
|
||||
|
||||
/**
|
||||
* transition function to replicate `request` style requests using axios
|
||||
*
|
||||
|
|
@ -253,6 +257,7 @@ module.exports.lockKeysFromRequest = lockKeysFromRequest;
|
|||
module.exports.getLargestNumber = getLargestNumber;
|
||||
module.exports.stringify = stringify;
|
||||
module.exports.stripWindowsDriveLetter = stripWindowsDriveLetter;
|
||||
module.exports.hasWindowsDriveLetter = hasWindowsDriveLetter;
|
||||
module.exports.axios_request = axios_request;
|
||||
module.exports.default_supported_block_filesystems =
|
||||
default_supported_block_filesystems;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
const { result } = require("lodash");
|
||||
const _ = require("lodash");
|
||||
const GeneralUtils = require("./general");
|
||||
const Powershell = require("./powershell").Powershell;
|
||||
|
||||
/**
|
||||
|
|
@ -757,6 +757,16 @@ class Windows {
|
|||
|
||||
async UnmountVolume(volumeId, path) {
|
||||
let command;
|
||||
|
||||
// this errors if it does not have a drive letter
|
||||
if (!GeneralUtils.hasWindowsDriveLetter(path)) {
|
||||
let item = await this.GetItem(path);
|
||||
if (!item) {
|
||||
return;
|
||||
}
|
||||
path = item.FullName;
|
||||
}
|
||||
|
||||
command = `Get-Volume -UniqueId \"${volumeId}\" | Get-Partition | Remove-PartitionAccessPath -AccessPath ${path}`;
|
||||
|
||||
await this.ps.exec(command);
|
||||
|
|
|
|||
Loading…
Reference in New Issue