Skip to content

Commit

Permalink
🎨 Uses named imports for chalk
Browse files Browse the repository at this point in the history
  • Loading branch information
mixn committed Oct 15, 2018
1 parent 154eb1c commit 6e7babc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const asyncRename = promisify(require('fs').rename);

// Packages
const meow = require('meow');
const chalk = require('chalk');
const {bold, red, green} = require('chalk');
const opn = require('opn');
const queryString = require('query-string');
const terminalImage = require('terminal-image');
Expand All @@ -28,10 +28,10 @@ const {CARBON_URL, LATEST_PRESET} = require('./src/helpers/globals');
let settings = require('./src/helpers/default-settings');

const cli = meow(`
${chalk.bold('Usage')}
${bold('Usage')}
$ carbon-now <file>
${chalk.bold('Options')}
${bold('Options')}
-s, --start Starting line of <file>
-e, --end Ending line of <file>
-i, --interactive Interactive mode
Expand All @@ -43,7 +43,7 @@ const cli = meow(`
-h, --headless Use only non-experimental Puppeteer features
--config Use a different, local config (read-only)
${chalk.bold('Examples')}
${bold('Examples')}
See: https://github.com/mixn/carbon-now-cli#examples
`,
{
Expand Down Expand Up @@ -106,7 +106,7 @@ let url = CARBON_URL;
// Deny everything if not at least one argument (file) specified
if (!file) {
console.error(`
${chalk.red('Error: Please provide at least a file.')}
${red('Error: Please provide at least a file.')}
$ carbon-now <file>
`);
Expand Down Expand Up @@ -233,7 +233,7 @@ if (!file) {
.run()
.then(async ({savedAs}) => {
console.log(`
${chalk.green('Done!')}`
${green('Done!')}`
);

if (open) {
Expand Down Expand Up @@ -262,7 +262,7 @@ if (!file) {
})
.catch(error => {
console.error(`
${chalk.red('Error: Sending code to https://carbon.now.sh went wrong.')}
${red('Error: Sending code to https://carbon.now.sh went wrong.')}
This is mostly due to:
Expand Down
4 changes: 2 additions & 2 deletions src/preset.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Packages
const fileExists = require('file-exists');
const jsonFile = require('jsonfile');
const chalk = require('chalk');
const {yellow} = require('chalk');
const {omit} = require('lodash');

// Source
Expand Down Expand Up @@ -52,7 +52,7 @@ const getPreset = async (presetName, configLocation = FULL_CONFIG_PATH) => {
// Warn if anything but 'latest-preset' is passed, but non-existent
if (presetName !== LATEST_PRESET) {
console.error(`
${chalk.yellow('Warning: Preset doesn’t exist. Using default settings…\n')}`
${yellow('Warning: Preset doesn’t exist. Using default settings…\n')}`
);
}

Expand Down

0 comments on commit 6e7babc

Please sign in to comment.