Download wp-calypso/bin/install-if-no-packages.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 496 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/bin/install-if-no-packages.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/bin/install-if-no-packages.js
-
curl -L -o install-if-no-packages.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/bin/install-if-no-packages.js
496 Bytes
| const { spawnSync } = require( 'child_process' ); | |
| const fs = require( 'fs' ); | |
| if ( ! fs.existsSync( 'node_modules' ) ) { | |
| console.log( 'No "node_modules" present, installing dependencies…' ); | |
| const installResult = spawnSync( 'yarn', [ 'install', '--immutable' ], { | |
| shell: true, | |
| stdio: 'inherit', | |
| env: { ...process.env }, | |
| } ); | |
| if ( installResult.status ) { | |
| console.error( 'failed to install: exited with code %d', installResult.status ); | |
| process.exit( installResult.status ); | |
| } | |
| } | |