summaryrefslogtreecommitdiffstats
path: root/src/context.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/context.rs')
-rw-r--r--src/context.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/context.rs b/src/context.rs
index 936dce9db..f1ab29977 100644
--- a/src/context.rs
+++ b/src/context.rs
@@ -39,7 +39,12 @@ impl<'a> Context<'a> {
let path = arguments
.value_of("path")
.map(From::from)
- .unwrap_or_else(|| env::current_dir().expect("Unable to identify current directory."));
+ .unwrap_or_else(|| {
+ env::var("PWD").map(PathBuf::from).unwrap_or_else(|err| {
+ log::debug!("Unable to get path from $PWD: {}", err);
+ env::current_dir().expect("Unable to identify current directory.")
+ })
+ });
Context::new_with_dir(arguments, path)
}