feat(task): add unstable warning to deno task (#13966)

This commit is contained in:
David Sherret 2022-03-15 21:24:07 -04:00 committed by GitHub
parent a7bef54d3f
commit 748aff1e94
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 14 additions and 7 deletions

View file

@ -52,6 +52,10 @@ pub async fn execute_script(
flags: Flags,
task_flags: TaskFlags,
) -> Result<i32, AnyError> {
log::warn!(
"{} deno task is unstable and may drastically change in the future",
crate::colors::yellow("Warning"),
);
let flags = Arc::new(flags);
let ps = ProcState::build(flags.clone()).await?;
let tasks_config = get_tasks_config(ps.maybe_config_file.as_ref())?;
@ -81,13 +85,14 @@ pub async fn execute_script(
.collect::<Vec<_>>()
.join(" ");
let script = format!("{} {}", script, additional_args);
let script = script.trim();
log::info!(
"{} {} {}",
colors::green("Task"),
colors::cyan(&task_name),
script
script,
);
let seq_list = deno_task_shell::parser::parse(&script)
let seq_list = deno_task_shell::parser::parse(script)
.with_context(|| format!("Error parsing script '{}'.", task_name))?;
let env_vars = std::env::vars().collect::<HashMap<String, String>>();
let exit_code = deno_task_shell::execute(seq_list, env_vars, cwd).await;