From 0ef02778823b961fba55b6c2f99fb0418c5574b4 Mon Sep 17 00:00:00 2001 From: Darren Schroeder <343840+fdncred@users.noreply.github.com> Date: Fri, 21 Jan 2022 13:20:13 -0600 Subject: [PATCH] allow `use` to parse quoted paths (#800) --- crates/nu-parser/src/parse_keywords.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/nu-parser/src/parse_keywords.rs b/crates/nu-parser/src/parse_keywords.rs index d678e59d3..49f3f3c8f 100644 --- a/crates/nu-parser/src/parse_keywords.rs +++ b/crates/nu-parser/src/parse_keywords.rs @@ -865,7 +865,9 @@ pub fn parse_use( } else { // TODO: Do not close over when loading module from file // It could be a file - if let Ok(module_filename) = String::from_utf8(import_pattern.head.name) { + if let Ok(module_filename) = + String::from_utf8(trim_quotes(&import_pattern.head.name).to_vec()) + { if let Ok(module_path) = canonicalize_with(&module_filename, cwd) { let module_name = if let Some(stem) = module_path.file_stem() { stem.to_string_lossy().to_string()