From 5be4081fa0203a9bc3c34d9203a19f82330859c2 Mon Sep 17 00:00:00 2001 From: Michael Downton Date: Fri, 20 Mar 2026 11:22:20 +1100 Subject: [PATCH] Remove skipped tasks from the stack. _initInvocationChain pushes the task to the stack and is called on task.invoke and task.execute. When a task skips (like a file task does) the task.run() checks to see if it needs to be evaluated and if not, skips the task. Unfortunately it leaves the task on the stack causing some weird finished task messaging and can lead to early bailing. Lets just pop the task from the stack when skipped. --- lib/task/task.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/task/task.js b/lib/task/task.js index 7833b50..3c0e3c3 100644 --- a/lib/task/task.js +++ b/lib/task/task.js @@ -285,6 +285,8 @@ class Task extends EventEmitter { let hasAction = typeof this.action == 'function'; if (!this.isNeeded()) { + jake._invocationChain.splice(jake._invocationChain.indexOf(this), 1); + this.emit('skip'); this.emit('_done'); }