UNPKG

542 BJavaScriptView Raw
1/**
2 * Handle if there's no block name.
3 */
4
5'use strict';
6
7const chalk = require( 'chalk' );
8
9module.exports = () => {
10 // Stop if there's no block name to create the plugin dir.
11 console.log(
12 '\n❌ ',
13 chalk.black.bgRed( ' You forgot to specify a block name: \n' )
14 );
15 console.log(
16 ` ${ chalk.dim( 'create-guten-block' ) } ${ chalk.green( '<block-name>' ) }`
17 );
18 console.log( chalk.dim( '\nFor example: \n' ) );
19 console.log(
20 ` ${ chalk.dim( 'create-guten-block' ) } ${ chalk.green( 'my-block' ) }\n`
21 );
22 process.exit( 1 );
23};