From b3f1f3ba04e51554ab59d6255bf34a79a9c42bd0 Mon Sep 17 00:00:00 2001 From: Satya Rohith Date: Tue, 6 Aug 2024 20:35:30 +0530 Subject: feat: deno run (#24891) This PR updates `deno run` to fallback to executing tasks when there is no script with the specified name. If there are both script and a task with the same name then `deno run` will prioritise executing the script. --- cli/standalone/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cli/standalone') diff --git a/cli/standalone/mod.rs b/cli/standalone/mod.rs index 935e034df..e4661051a 100644 --- a/cli/standalone/mod.rs +++ b/cli/standalone/mod.rs @@ -131,6 +131,8 @@ struct EmbeddedModuleLoader { dynamic_permissions: PermissionsContainer, } +pub const MODULE_NOT_FOUND: &str = "Module not found"; + impl ModuleLoader for EmbeddedModuleLoader { fn resolve( &self, @@ -336,7 +338,7 @@ impl ModuleLoader for EmbeddedModuleLoader { let Some(module) = self.shared.eszip.get_module(original_specifier) else { return deno_core::ModuleLoadResponse::Sync(Err(type_error(format!( - "Module not found: {}", + "{MODULE_NOT_FOUND}: {}", original_specifier )))); }; -- cgit v1.2.3