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:
@ -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"))]
|
||||
|
Reference in New Issue
Block a user