From e8f22c076525c2fa55115349157f67085df287bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Mon, 13 Mar 2023 13:50:23 -0400 Subject: refactor(core): pass cwd explicitly to resolve_path (#18092) Towards landing #15454 --- ext/node/ops.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'ext') diff --git a/ext/node/ops.rs b/ext/node/ops.rs index 046578ca5..fc192637a 100644 --- a/ext/node/ops.rs +++ b/ext/node/ops.rs @@ -1,5 +1,6 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. +use deno_core::anyhow::Context; use deno_core::error::generic_error; use deno_core::error::AnyError; use deno_core::normalize_path; @@ -93,10 +94,13 @@ where P: NodePermissions + 'static, { // Guarantee that "from" is absolute. - let from = deno_core::resolve_path(&from) - .unwrap() - .to_file_path() - .unwrap(); + let from = deno_core::resolve_path( + &from, + &std::env::current_dir().context("Unable to get CWD")?, + ) + .unwrap() + .to_file_path() + .unwrap(); ensure_read_permission::

(state, &from)?; -- cgit v1.2.3