From c6bbf140edeb1c4a7a8454dd4998a099241fefc7 Mon Sep 17 00:00:00 2001 From: Sam Hedin Date: Thu, 25 Jun 2020 20:44:01 +0200 Subject: [PATCH] parsing and error msg --- crates/nu-cli/src/env/directory_specific_environment.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/nu-cli/src/env/directory_specific_environment.rs b/crates/nu-cli/src/env/directory_specific_environment.rs index 62995fa0f6..313ebd0bc2 100644 --- a/crates/nu-cli/src/env/directory_specific_environment.rs +++ b/crates/nu-cli/src/env/directory_specific_environment.rs @@ -41,9 +41,10 @@ impl DirectorySpecificEnvironment { let content = std::str::from_utf8(&content.as_slice()).or_else(|_| { Err(ShellError::untagged_runtime_error(format!("Could not read {:?} as utf8 string", content))) })?; + let content = std::fs::read_to_string(&wdirenv)?; return Ok(content.parse::().or_else(|_| { Err(ShellError::untagged_runtime_error(format!( - "Could not parse {:?}. Is it well-formed?", + "Could not parse {:?}. Is it well-formed? Each entry must be written as key = \"value\" (note the quotation marks)", wdirenv ))) })?);