clap-utils: trim single-quotes from signer uris on windows

This commit is contained in:
Trent Nelson 2021-10-13 21:23:28 -06:00 committed by Trent Nelson
parent 0c66099cec
commit 6649dfa899
1 changed files with 9 additions and 0 deletions

View File

@ -258,6 +258,15 @@ pub(crate) fn parse_signer_source<S: AsRef<str>>(
let source = {
#[cfg(target_family = "windows")]
{
// trim matched single-quotes since cmd.exe won't
let mut source = source;
while let Some(trimmed) = source.strip_prefix('\'') {
source = if let Some(trimmed) = trimmed.strip_suffix('\'') {
trimmed
} else {
break;
}
}
source.replace("\\", "/")
}
#[cfg(not(target_family = "windows"))]