summaryrefslogtreecommitdiff
path: root/runtime/examples
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-03-13 13:50:23 -0400
committerGitHub <noreply@github.com>2023-03-13 18:50:23 +0100
commite8f22c076525c2fa55115349157f67085df287bf (patch)
treedf4105ee11bd69a4de1a138a26d6b44bca131ea1 /runtime/examples
parent4c2aeb250241fff5084cf31747ab53f4a0ecad79 (diff)
refactor(core): pass cwd explicitly to resolve_path (#18092)
Towards landing #15454
Diffstat (limited to 'runtime/examples')
-rw-r--r--runtime/examples/hello_runtime.rs6
1 files changed, 5 insertions, 1 deletions
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(