mirror of
https://github.com/nushell/nushell
synced 2025-01-16 15:14:26 +00:00
Rename env file to .nu-env (#1953)
This commit is contained in:
parent
2fa83b0bbe
commit
3bb2c9beed
1 changed files with 3 additions and 6 deletions
|
@ -101,7 +101,7 @@ impl DirectorySpecificEnvironment {
|
||||||
//Start in the current directory, then traverse towards the root with working_dir to see if we are in a subdirectory of a valid directory.
|
//Start in the current directory, then traverse towards the root with working_dir to see if we are in a subdirectory of a valid directory.
|
||||||
while let Some(wdir) = working_dir {
|
while let Some(wdir) = working_dir {
|
||||||
if wdir == dir.as_path() {
|
if wdir == dir.as_path() {
|
||||||
let toml_doc = std::fs::read_to_string(wdir.join(".nu").as_path())?
|
let toml_doc = std::fs::read_to_string(wdir.join(".nu-env").as_path())?
|
||||||
.parse::<toml::Value>()?;
|
.parse::<toml::Value>()?;
|
||||||
|
|
||||||
let vars_in_current_file = toml_doc
|
let vars_in_current_file = toml_doc
|
||||||
|
@ -109,15 +109,12 @@ impl DirectorySpecificEnvironment {
|
||||||
.ok_or_else(|| {
|
.ok_or_else(|| {
|
||||||
std::io::Error::new(
|
std::io::Error::new(
|
||||||
std::io::ErrorKind::InvalidData,
|
std::io::ErrorKind::InvalidData,
|
||||||
"No [env] section in .nu-file",
|
"No [env] section in .nu-env",
|
||||||
)
|
)
|
||||||
})?
|
})?
|
||||||
.as_table()
|
.as_table()
|
||||||
.ok_or_else(|| {
|
.ok_or_else(|| {
|
||||||
Error::new(
|
Error::new(ErrorKind::InvalidData, "Malformed [env] section in .nu-env")
|
||||||
ErrorKind::InvalidData,
|
|
||||||
"Malformed [env] section in .nu-file",
|
|
||||||
)
|
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let mut keys_in_current_nufile = vec![];
|
let mut keys_in_current_nufile = vec![];
|
||||||
|
|
Loading…
Reference in a new issue