Download wp-calypso/packages/calypso-doctor/cli.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.38 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/calypso-doctor/cli.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/packages/calypso-doctor/cli.js
-
curl -L -o cli.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/calypso-doctor/cli.js
1.38 kB
| const chalk = require( 'chalk' ); | |
| const yargs = require( 'yargs' ); | |
| const { runEvaluations } = require( './index.js' ); | |
| const main = async () => { | |
| console.log( chalk.yellow( '-=- Calypso Doctor -=-' ) ); | |
| console.log( 'Checking the health of your system...' ); | |
| console.log( | |
| chalk.gray( | |
| "If you don't want to run this tool automatically, set the env var CALYPSO_DOCTOR_SKIP=true" | |
| ) | |
| ); | |
| const results = await runEvaluations(); | |
| console.log( '' ); | |
| console.log( chalk.yellow( 'Tests' ) ); | |
| results.forEach( ( { title, group, result, ignored, evaluationMessage } ) => { | |
| if ( ignored ) { | |
| console.log( `* ${ chalk.gray( '?' ) } ${ group } > ${ title }` ); | |
| } else if ( result ) { | |
| console.log( `* ${ chalk.green( '✓' ) } ${ group } > ${ title }` ); | |
| } else { | |
| console.log( `* ${ chalk.red( '✗' ) } ${ group } > ${ title }` ); | |
| } | |
| if ( evaluationMessage ) { | |
| console.log( ` ${ evaluationMessage }` ); | |
| } | |
| } ); | |
| console.log( '' ); | |
| console.log( chalk.yellow( 'Fixes' ) ); | |
| if ( results.some( ( r ) => r.fixMessage ) ) { | |
| results.forEach( ( { fixMessage } ) => { | |
| if ( fixMessage ) { | |
| console.log( `> ${ fixMessage }` ); | |
| } | |
| } ); | |
| } else { | |
| console.log( `Nothing to fix, your system is ${ chalk.greenBright( 'ready' ) }!` ); | |
| } | |
| console.log( '' ); | |
| }; | |
| main( yargs.usage( 'Usage: $0' ).help( 'h' ).alias( 'h', 'help' ).argv ); | |