diff --git a/lib/render.js b/lib/render.js index 628576df..8956afe5 100644 --- a/lib/render.js +++ b/lib/render.js @@ -1,5 +1,6 @@ 'use strict'; const chalk = require('chalk'); +const hasUnicode = require('has-unicode'); const signale = require('signale'); const config = require('./config'); @@ -10,6 +11,8 @@ const {blue, green, grey, magenta, red, underline, yellow} = chalk; const priorities = {2: 'yellow', 3: 'red'}; +const chStar = hasUnicode() ? '★' : '*'; + class Render { get _configuration() { return config.get(); @@ -52,7 +55,7 @@ class Render { } _getStar(item) { - return item.isStarred ? yellow('★') : ''; + return item.isStarred ? yellow(chStar) : ''; } _buildTitle(key, items) { @@ -177,11 +180,11 @@ class Render { ]; if (complete !== 0 && pending === 0 && notes === 0) { - log({prefix: '\n ', message: 'All done!', suffix: yellow('★')}); + log({prefix: '\n ', message: 'All done!', suffix: hasUnicode() ? yellow(chStar) : yellow('^_^')}); } if (pending + complete + notes === 0) { - log({prefix: '\n ', message: 'Type `tb --help` to get started!', suffix: yellow('★')}); + log({prefix: '\n ', message: 'Type `tb --help` to get started!', suffix: yellow(chStar)}); } log({prefix: '\n ', message: grey(`${percent} of all tasks complete.`)}); diff --git a/package.json b/package.json index 57d21c7a..9150ddab 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "taskbook", "productName": "Taskbook", "version": "0.1.1", - "description": "📓 Tasks, boards & notes for the command-line habitat", + "description": "Tasks, boards & notes for the command-line habitat", "repository": "klauscfhq/taskbook", "license": "MIT", "author": { @@ -45,6 +45,7 @@ }, "dependencies": { "chalk": "^2.4.1", + "has-unicode": "^2.0.1", "meow": "^5.0.0", "signale": "^1.2.1", "update-notifier": "^2.5.0"