mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-24 06:35:49 +03: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
@ -1,5 +1,6 @@
|
|||||||
const Api = require('sywac/api');
|
const Api = require('sywac/api');
|
||||||
const styles = require('./styles');
|
const styles = require('./styles');
|
||||||
|
const ui = require('./ui');
|
||||||
/**
|
/**
|
||||||
* Pretty CLI
|
* Pretty CLI
|
||||||
*
|
*
|
||||||
@ -24,3 +25,6 @@ module.exports.Api = Api;
|
|||||||
|
|
||||||
// Export the styles
|
// Export the styles
|
||||||
module.exports.styles = 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…
Reference in New Issue
Block a user