summaryrefslogtreecommitdiff
path: root/cli/tools/task.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-03-03 18:27:05 -0400
committerGitHub <noreply@github.com>2023-03-03 18:27:05 -0400
commit84bafd11d52609e74a52df8e57752d5e3c25f717 (patch)
treecdc282ab3a808bc29987cdb45c0b462ae1e080ec /cli/tools/task.rs
parent5c43e2a665c9dae7aff3ba757e589f10ec3aa062 (diff)
fix: lazily surface errors in package.json deps parsing (#17974)
Closes #17941
Diffstat (limited to 'cli/tools/task.rs')
-rw-r--r--cli/tools/task.rs21
1 files changed, 17 insertions, 4 deletions
diff --git a/cli/tools/task.rs b/cli/tools/task.rs
index 9b76f256c..65601aa69 100644
--- a/cli/tools/task.rs
+++ b/cli/tools/task.rs
@@ -60,11 +60,28 @@ pub async fn execute_script(
.await;
Ok(exit_code)
} else if let Some(script) = package_json_scripts.get(task_name) {
+ if let Some(package_deps) = ps.package_json_deps_installer.package_deps() {
+ for (key, value) in package_deps {
+ if let Err(err) = value {
+ log::info!(
+ "{} Ignoring dependency '{}' in package.json because its version requirement failed to parse: {:#}",
+ colors::yellow("Warning"),
+ key,
+ err,
+ );
+ }
+ }
+ }
ps.package_json_deps_installer
.ensure_top_level_install()
.await?;
ps.npm_resolver.resolve_pending().await?;
+ log::info!(
+ "{} Currently only basic package.json `scripts` are supported. Programs like `rimraf` or `cross-env` will not work correctly. This will be fixed in the upcoming release.",
+ colors::yellow("Warning"),
+ );
+
let cwd = match task_flags.cwd {
Some(path) => canonicalize_path(&PathBuf::from(path))?,
None => maybe_package_json
@@ -76,10 +93,6 @@ pub async fn execute_script(
.to_owned(),
};
let script = get_script_with_args(script, &ps);
- log::info!(
- "{} Currently only basic package.json `scripts` are supported. Programs like `rimraf` or `cross-env` will not work correctly. This will be fixed in the upcoming release.",
- colors::yellow("Warning"),
- );
output_task(task_name, &script);
let seq_list = deno_task_shell::parser::parse(&script)
.with_context(|| format!("Error parsing script '{task_name}'."))?;