diff options
Diffstat (limited to 'cli/args/mod.rs')
-rw-r--r-- | cli/args/mod.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/cli/args/mod.rs b/cli/args/mod.rs index c65745e29..17711371a 100644 --- a/cli/args/mod.rs +++ b/cli/args/mod.rs @@ -939,6 +939,17 @@ impl CliOptions { .map(Some) } + pub fn node_ipc_fd(&self) -> Option<i32> { + let maybe_node_channel_fd = std::env::var("DENO_CHANNEL_FD").ok(); + if let Some(node_channel_fd) = maybe_node_channel_fd { + // Remove so that child processes don't inherit this environment variable. + std::env::remove_var("DENO_CHANNEL_FD"); + node_channel_fd.parse::<i32>().ok() + } else { + None + } + } + pub fn resolve_main_module(&self) -> Result<ModuleSpecifier, AnyError> { match &self.flags.subcommand { DenoSubcommand::Bundle(bundle_flags) => { |