Skip to content

Commit

Permalink
fix(figures): made microsoft icons to use the fancy ones, even though…
Browse files Browse the repository at this point in the history
… it may fail in some cases

re #31
  • Loading branch information
cenk1cenk2 committed May 24, 2020
1 parent 5ee6603 commit f0e5817
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
20 changes: 10 additions & 10 deletions src/renderer/default.renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export class DefaultRenderer implements ListrRenderer {

} else {
// some sibling task but self has failed and this has stopped
output.push(this.formatString(task.title, chalk.red(figures.squareSmallFilled), level))
output.push(this.formatString(task.title, chalk.red(figures.main.squareSmallFilled), level))

}
}
Expand Down Expand Up @@ -245,37 +245,37 @@ export class DefaultRenderer implements ListrRenderer {
}

if (task.isPending() && !data) {
return this.options.showSubtasks !== false && task.hasSubtasks() ? chalk.yellow(figures.pointer) : chalk.yellowBright(task.spinner())
return this.options.showSubtasks !== false && task.hasSubtasks() ? chalk.yellow(figures.main.pointer) : chalk.yellowBright(task.spinner())
}

if (task.isCompleted() && !data) {
if (task.hasSubtasks() && task.subtasks.some((subtask) => subtask.hasFailed())) {
return chalk.yellow(figures.warning)
return chalk.yellow(figures.main.warning)
}

return chalk.green(figures.tick)
return chalk.green(figures.main.tick)
}

if (task.hasFailed() && !data) {
return task.hasSubtasks() ? chalk.red(figures.pointer) : chalk.red(figures.cross)
return task.hasSubtasks() ? chalk.red(figures.main.pointer) : chalk.red(figures.main.cross)
}

if (task.isSkipped() && !data && this.options.collapseSkips === false) {
return chalk.yellow(figures.warning)
return chalk.yellow(figures.main.warning)

} else if (task.isSkipped() && (data || this.options.collapseSkips)) {
return chalk.yellow(figures.arrowDown)
return chalk.yellow(figures.main.arrowDown)

}

if (task.isPrompt()) {
return chalk.cyan(figures.questionMarkPrefix)
return chalk.cyan(figures.main.questionMarkPrefix)
}

if (!data) {
return chalk.dim(figures.squareSmallFilled)
return chalk.dim(figures.main.squareSmallFilled)
} else {
return figures.pointerSmall
return figures.main.pointerSmall
}
}
}
12 changes: 6 additions & 6 deletions src/utils/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class Logger {
case logLevels.fail:
if (this.options?.useIcons) {
coloring = chalk.red
icon = figures.cross
icon = figures.main.cross
} else {
icon = '[FAILED]'
}
Expand All @@ -84,36 +84,36 @@ export class Logger {
case logLevels.skip:
if (this.options?.useIcons) {
coloring = chalk.yellow
icon = figures.arrowDown
icon = figures.main.arrowDown
} else {
icon ='[SKIPPED]'
}
break
case logLevels.success:
if (this.options?.useIcons) {
coloring = chalk.green
icon = figures.tick
icon = figures.main.tick
} else {
icon = '[SUCCESS]'
}
break
case logLevels.data:
if (this.options?.useIcons) {
icon = figures.arrowRight
icon = figures.main.arrowRight
} else {
icon = '[DATA]'
}
break
case logLevels.start:
if (this.options?.useIcons) {
icon = figures.pointer
icon = figures.main.pointer
} else {
icon = '[STARTED]'
}
break
case logLevels.title:
if (this.options?.useIcons) {
icon = figures.checkboxOn
icon = figures.main.checkboxOn
} else {
icon = '[TITLE]'
}
Expand Down

0 comments on commit f0e5817

Please sign in to comment.