Skip to content

Commit

Permalink
Basic color updates
Browse files Browse the repository at this point in the history
  • Loading branch information
abea committed May 19, 2020
1 parent c706ce9 commit e1d75f3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
12 changes: 7 additions & 5 deletions lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ const confUtils = require('./conf-utils');

module.exports = util;

var prefix = ' Apostrophe '.bgWhite.red.bold;
var prefix = ' Apostrophe '.black.bgWhite.bold;

util.styleCommand = function(commandName) {
return ' '.bgRed + commandName.bgRed.white + ' '.bgRed;
util.styleCommand = function(commandName, style) {
const bgStyle = style === 'danger' ? 'bgRed'
: style === 'success' ? 'bgGreen' : 'bgBlue';
return ' '[bgStyle] + commandName[bgStyle].white + ' '[bgStyle];
};

util.nlog = function(commandName, message) {
Expand All @@ -24,7 +26,7 @@ util.nlog = function(commandName, message) {

util.success = function(commandName) {
console.log(' ');
console.log(prefix + util.styleCommand(commandName) + " Finished successfully.".green);
console.log(prefix + util.styleCommand(commandName, 'success') + " Finished successfully.".green);

const approvedAnalytics = confUtils.getConf('enableAnalytics');

Expand All @@ -35,7 +37,7 @@ util.success = function(commandName) {

util.error = function(commandName, msg) {
console.error(' ');
console.error(prefix + util.styleCommand(commandName) + " Failed".red);
console.error(prefix + util.styleCommand(commandName, 'danger') + " Failed".red);
if (msg) {
console.error('\n' + msg.red + '\n');
}
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"url": "https://github.com/apostrophecms/apostrophe-cli.git"
},
"dependencies": {
"colors": "~1.0.x",
"colors": "^1.4.0",
"commander": "^5.1.0",
"conf": "^6.2.4",
"lodash": "^4.17.15",
Expand Down

0 comments on commit e1d75f3

Please sign in to comment.