mirror of
https://github.com/nushell/nushell.git
synced 2024-11-26 02:13:47 +01:00
fix plugin path with whitespace (#5871)
This commit is contained in:
parent
533e04a60a
commit
f02076daa8
@ -362,9 +362,18 @@ impl EngineState {
|
||||
// No need to check the None option
|
||||
let (path, encoding, shell) =
|
||||
decl.is_plugin().expect("plugin should have file name");
|
||||
let file_name = path
|
||||
let mut file_name = path
|
||||
.to_str()
|
||||
.expect("path was checked during registration as a str");
|
||||
.expect("path was checked during registration as a str")
|
||||
.to_string();
|
||||
|
||||
// Fix files or folders with quotes
|
||||
if file_name.contains('\'')
|
||||
|| file_name.contains('"')
|
||||
|| file_name.contains(' ')
|
||||
{
|
||||
file_name = format!("`{}`", file_name);
|
||||
}
|
||||
|
||||
serde_json::to_string_pretty(&decl.signature())
|
||||
.map(|signature| {
|
||||
|
Loading…
Reference in New Issue
Block a user