Bail and signal error when the cwd of a resolved task doesn't exist (#32777)

Closes #32688

Release Notes:

- Fixed tasks (including build tasks for debug configurations) silently
using `/` as a working directory when the specified `cwd` didn't exist.
This commit is contained in:
Cole Miller 2025-06-16 16:59:49 -04:00 committed by GitHub
parent 0f0ff40c6d
commit 22a2ff4f12
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 54 additions and 4 deletions

View file

@ -850,9 +850,18 @@ impl RunningState {
(task, None)
}
};
let Some(task) = task_template.resolve_task("debug-build-task", &task_context) else {
let Some(task) = task_template.resolve_task_and_check_cwd("debug-build-task", &task_context, cx.background_executor().clone()) else {
anyhow::bail!("Could not resolve task variables within a debug scenario");
};
let task = match task.await {
Ok(task) => task,
Err(e) => {
workspace.update(cx, |workspace, cx| {
workspace.show_error(&e, cx);
}).ok();
return Err(e)
}
};
let locator_name = if let Some(locator_name) = locator_name {
debug_assert!(!config_is_valid);