summaryrefslogtreecommitdiff
path: root/cli/standalone
diff options
context:
space:
mode:
authorSatya Rohith <me@satyarohith.com>2024-08-06 20:35:30 +0530
committerGitHub <noreply@github.com>2024-08-06 20:35:30 +0530
commitb3f1f3ba04e51554ab59d6255bf34a79a9c42bd0 (patch)
tree6455a67387f69c01803e12bc1652eeb0f7dbf7ca /cli/standalone
parent897159dc6e1b2319cf2f5f09d8d6cecc0d3175fa (diff)
feat: deno run <task> (#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.
Diffstat (limited to 'cli/standalone')
-rw-r--r--cli/standalone/mod.rs4
1 files changed, 3 insertions, 1 deletions
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
))));
};