Skip to content

Commit 8d5d3f7

Browse files
committed
Add docblock to the retry command.
1 parent 0f380f1 commit 8d5d3f7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tools/local-env/scripts/install.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,15 @@ function wp_cli( cmd ) {
6767
execSync( `npm --silent run env:cli -- ${cmd} --path=/var/www/${process.env.LOCAL_DIR}`, { stdio: 'inherit' } );
6868
}
6969

70+
/**
71+
* Runs a WP-CLI command in the Docker environment with retry logic.
72+
*
73+
* If the command fails, the function will retry the command the
74+
* specified number of times with a short delay between attempts.
75+
*
76+
* @param {string} cmd The WP-CLI command to run.
77+
* @param {number} retries The number of retries left. Default to 5.
78+
*/
7079
function wp_cli_retry( cmd, retries = 5 ) {
7180
try {
7281
wp_cli( cmd );

0 commit comments

Comments
 (0)