mirror of
https://github.com/nushell/nushell
synced 2024-11-10 07:04:13 +00:00
Allow config to be readonly (#1967)
This commit is contained in:
parent
982f067d0e
commit
a268e825aa
1 changed files with 5 additions and 1 deletions
|
@ -65,7 +65,11 @@ pub fn read(
|
|||
Some(ref file) => file.clone(),
|
||||
};
|
||||
|
||||
touch(&filename)?;
|
||||
if !filename.exists() && touch(&filename).is_err() {
|
||||
// If we can't create configs, let's just return an empty indexmap instead as we may be in
|
||||
// a readonly environment
|
||||
return Ok(IndexMap::new());
|
||||
}
|
||||
|
||||
trace!("config file = {}", filename.display());
|
||||
|
||||
|
|
Loading…
Reference in a new issue