clap-utils: trim single-quotes from signer uris on windows (#20695)

(cherry picked from commit 6649dfa899)

Co-authored-by: Trent Nelson <trent@solana.com>
This commit is contained in:
mergify[bot]
2021-10-14 20:23:15 +00:00
committed by GitHub
parent 88e6f41bec
commit 63ac5e4561

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"))]