Skip to content

Commit

Permalink
refactor: if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
artegoser committed Aug 27, 2023
1 parent 8ba0532 commit c1c1dda
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/prompts/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -781,11 +781,11 @@ export type Task = {
*/
export const tasks = async (tasks: Task[]) => {
for (const task of tasks) {
if (task.enabled !== false) {
const s = spinner();
s.start(task.title);
const result = await task.task(s.message);
s.stop(result || task.title);
}
if (task.enabled === false) continue;

const s = spinner();
s.start(task.title);
const result = await task.task(s.message);
s.stop(result || task.title);
}
};

0 comments on commit c1c1dda

Please sign in to comment.