UNPKG

855 BJavaScriptView Raw
1/**
2 * Environment Info
3 *
4 * Prints envinfo for debugging.
5 */
6
7'use strict';
8
9const chalk = require( 'chalk' );
10const envinfo = require( 'envinfo' );
11const clearConsole = require( './consoleClear' );
12
13module.exports = program => {
14 // Envinfo.
15 if ( program.debug ) {
16 clearConsole();
17
18 console.log(
19 '\n🔰 ' +
20 chalk.black.bgYellow( ' Printing the debug env info below: \n\n' ) +
21 chalk.dim( ' This may take a couple of seconds...' )
22 );
23
24 // Print the envinfo.
25 envinfo.print( {
26 packages: [ 'cgb-scripts' ],
27 cpu: true,
28 duplicates: true,
29 browsers: true,
30 noNativeIDE: true,
31 } );
32
33 console.log(
34 '\n✅ ' +
35 chalk.black.bgGreen( ' Done ' ) +
36 chalk.dim( ' You can copy paste this info to share it...\n' )
37 );
38 // Let's end the process so the app doesn't continue.
39 process.exit( 0 );
40 } // End Envinfo.
41};