Extract manual PWD extraction with method current_work_dir (#7812)

This commit is contained in:
Hofer-Julian
2023-01-21 14:44:17 +01:00
committed by GitHub
parent e6f6f17c6d
commit 2d98d0fcc2
4 changed files with 9 additions and 24 deletions

View File

@ -965,6 +965,12 @@ impl EngineState {
self.get_module_comments(module_id)
.map(|comment_spans| self.build_usage(comment_spans))
}
pub fn current_work_dir(&self) -> String {
self.get_env_var("PWD")
.map(|d| d.as_string().unwrap_or_default())
.unwrap_or_default()
}
}
/// A temporary extension to the global state. This handles bridging between the global state and the