mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
fix(flags): don't treat empty run command as task subcommand (#25708)
This commit is contained in:
parent
49a0b7ab93
commit
c90b074579
4 changed files with 22 additions and 20 deletions
|
@ -36,19 +36,7 @@ pub async fn execute_script(
|
|||
let cli_options = factory.cli_options()?;
|
||||
let start_dir = &cli_options.start_dir;
|
||||
if !start_dir.has_deno_or_pkg_json() {
|
||||
if task_flags.is_run {
|
||||
bail!(
|
||||
r#"deno run couldn't find deno.json(c).
|
||||
If you meant to run a script, specify it, e.g., `deno run ./script.ts`.
|
||||
To run a task, ensure the config file exists.
|
||||
Examples:
|
||||
- Script: `deno run ./script.ts`
|
||||
- Task: `deno run dev`
|
||||
See https://docs.deno.com/go/config"#
|
||||
)
|
||||
} else {
|
||||
bail!("deno task couldn't find deno.json(c). See https://docs.deno.com/go/config")
|
||||
}
|
||||
bail!("deno task couldn't find deno.json(c). See https://docs.deno.com/go/config")
|
||||
}
|
||||
let force_use_pkg_json =
|
||||
std::env::var_os(crate::task_runner::USE_PKG_JSON_HIDDEN_ENV_VAR_NAME)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue