1
0
mirror of https://github.com/nushell/nushell.git synced 2025-07-15 13:55:26 +02:00

Allow config to be readonly ()

This commit is contained in:
Jonathan Turner
2020-06-11 10:50:57 -07:00
committed by GitHub
parent 982f067d0e
commit a268e825aa

@ -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());