Skip to content

Commit

Permalink
Update src/state.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Kriese <[email protected]>
  • Loading branch information
stepchowfun and viceice authored Jul 14, 2021
1 parent dc7ff33 commit 09e077f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ pub struct State {
fn path() -> Option<PathBuf> {
// [tag:state_path_has_parent]
dirs::data_local_dir()
.map(|path| path.join("docuum/state.yml"))
.or_else(|| {
// In the `mcr.microsoft.com/windows/nanoserver` Docker image, `dirs::data_local_dir()`
// returns `None` (see https://github.com/dirs-dev/dirs-rs/issues/34 for details). So
// we fall back to the value of the `LOCALAPPDATA` environment variable in that case.
env::var("LOCALAPPDATA").ok().map(Into::into)
})
.map(|path| path.join("docuum/state.yml"))
}

// Return the state in which the program starts, if no state was loaded from disk.
Expand Down

0 comments on commit 09e077f

Please sign in to comment.