5.4 Module Specifier
let main_module = cli_options.resolve_main_module()?;Overview
DenoSubcommand::Run(run_flags) => {
if run_flags.is_stdin() {
std::env::current_dir()
.context("Unable to get CWD")
.and_then(|cwd| {
resolve_url_or_path("./$deno$stdin.ts", &cwd)
.map_err(AnyError::from)
})
} else if run_flags.watch.is_some() {
resolve_url_or_path(&run_flags.script, self.initial_cwd())
.map_err(AnyError::from)
} else if NpmPackageReqReference::from_str(&run_flags.script).is_ok() {
ModuleSpecifier::parse(&run_flags.script).map_err(AnyError::from)
} else {
resolve_url_or_path(&run_flags.script, self.initial_cwd())
.map_err(AnyError::from)
}
}Functionality

resolve_url_or_path
resolve_import
Last updated