summaryrefslogtreecommitdiff
path: root/cli/fs_util.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/fs_util.rs')
-rw-r--r--cli/fs_util.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/cli/fs_util.rs b/cli/fs_util.rs
index 584d62598..a862e4bd3 100644
--- a/cli/fs_util.rs
+++ b/cli/fs_util.rs
@@ -1,6 +1,7 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
use deno_core::error::AnyError;
+use deno_core::error::Context;
pub use deno_core::normalize_path;
use deno_runtime::deno_crypto::rand;
use std::env::current_dir;
@@ -81,7 +82,8 @@ pub fn resolve_from_cwd(path: &Path) -> Result<PathBuf, AnyError> {
let resolved_path = if path.is_absolute() {
path.to_owned()
} else {
- let cwd = current_dir().unwrap();
+ let cwd =
+ current_dir().context("Failed to get current working directory")?;
cwd.join(path)
};