mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 10:59:13 +00:00
refactor(core): pass cwd explicitly to resolve_path (#18092)
Towards landing #15454
This commit is contained in:
parent
4c2aeb2502
commit
e8f22c0765
7 changed files with 33 additions and 13 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue