mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-17 23:44:39 -05:00
🎨 Move Slimer UI into Pretty CLI
- We'll want these log utils in other cli tools
This commit is contained in:
parent
e80f4e93f2
commit
dfe1610a47
2 changed files with 19 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
const Api = require('sywac/api');
|
||||
const styles = require('./styles');
|
||||
const ui = require('./ui');
|
||||
/**
|
||||
* Pretty CLI
|
||||
*
|
||||
|
@ -24,3 +25,6 @@ module.exports.Api = Api;
|
|||
|
||||
// Export the styles
|
||||
module.exports.styles = styles;
|
||||
|
||||
// Export our ui tools
|
||||
module.exports.ui = ui;
|
||||
|
|
15
ghost/pretty-cli/ui.js
Normal file
15
ghost/pretty-cli/ui.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
const chalk = require('chalk');
|
||||
const log = (...args) => console.log(...args); // eslint-disable-line no-console
|
||||
|
||||
module.exports.log = log;
|
||||
module.exports.log.error = (...args) => {
|
||||
log(chalk.red('error'), ...args);
|
||||
};
|
||||
|
||||
module.exports.log.info = (...args) => {
|
||||
log(chalk.cyan('info'), ...args);
|
||||
};
|
||||
|
||||
module.exports.log.ok = (...args) => {
|
||||
log(chalk.green('ok'), ...args);
|
||||
};
|
Loading…
Add table
Reference in a new issue