summaryrefslogtreecommitdiff
path: root/core/examples/fs_module_loader.rs
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 /core/examples/fs_module_loader.rs
parent4c2aeb250241fff5084cf31747ab53f4a0ecad79 (diff)
refactor(core): pass cwd explicitly to resolve_path (#18092)
Towards landing #15454
Diffstat (limited to 'core/examples/fs_module_loader.rs')
-rw-r--r--core/examples/fs_module_loader.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/examples/fs_module_loader.rs b/core/examples/fs_module_loader.rs
index a8d33e104..737ff1d5c 100644
--- a/core/examples/fs_module_loader.rs
+++ b/core/examples/fs_module_loader.rs
@@ -1,5 +1,6 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
+use anyhow::Context;
use deno_core::anyhow::Error;
use deno_core::FsModuleLoader;
use deno_core::JsRuntime;
@@ -24,7 +25,10 @@ fn main() -> Result<(), Error> {
.enable_all()
.build()?;
- let main_module = deno_core::resolve_path(main_url)?;
+ let main_module = deno_core::resolve_path(
+ main_url,
+ &std::env::current_dir().context("Unable to get CWD")?,
+ )?;
let future = async move {
let mod_id = js_runtime.load_main_module(&main_module, None).await?;