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 --- runtime/examples/hello_runtime.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'runtime/examples') diff --git a/runtime/examples/hello_runtime.rs b/runtime/examples/hello_runtime.rs index b8b152467..ac872c192 100644 --- a/runtime/examples/hello_runtime.rs +++ b/runtime/examples/hello_runtime.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::AnyError; use deno_core::FsModuleLoader; use deno_runtime::deno_broadcast_channel::InMemoryBroadcastChannel; @@ -69,7 +70,10 @@ async fn main() -> Result<(), AnyError> { let js_path = Path::new(env!("CARGO_MANIFEST_DIR")).join("examples/hello_runtime.js"); - let main_module = deno_core::resolve_path(&js_path.to_string_lossy())?; + let main_module = deno_core::resolve_path( + &js_path.to_string_lossy(), + &std::env::current_dir().context("Unable to get CWD")?, + )?; let permissions = PermissionsContainer::allow_all(); let mut worker = MainWorker::bootstrap_from_options( -- cgit v1.2.3