Skip to content

Commit 6fef803

Browse files
committed
fix: taskslist add end flags
1 parent ed13298 commit 6fef803

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

examples/tasks.demo.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ const run = async ()=>{
7676
},
7777
{
7878
title: ["下载文件:{},大小:{}, 已下载{}", ["package.json", 122, 344]],
79+
end:false,
7980
execute: async function () {
8081
await delay();
8182
},
@@ -86,8 +87,7 @@ const run = async ()=>{
8687
grouped:true
8788
});
8889

89-
tasks.run("开始执行任务").then(() => {
90-
console.log("done");
90+
tasks.run("开始执行任务").then(() => {
9191
// logsets.run(["开始执行{}个任务",5],taskList).then(() => {
9292
// console.log("done");
9393
// });
@@ -103,7 +103,7 @@ const run = async ()=>{
103103
},{
104104
ignoreErrors:true
105105
});
106-
fntasks.run("开始执行任务2").then(() => {
106+
fntasks.run().then(() => {
107107
console.log("done");
108108
});
109109
},{

src/tasklist.plugin.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ function createTasks(logsetContext, tasks = [], options = {}) {
435435
const getTasks = typeof tasks == "function"
436436
? tasks
437437
: (index,end) => {
438-
if(index==tasks.length-1) end()
438+
if(index==tasks.length-1 && tasks[index].end!==false) end()
439439
return tasks[index];
440440
};
441441

0 commit comments

Comments
 (0)