diff --git a/README.md b/README.md index 73917db..e99704d 100644 --- a/README.md +++ b/README.md @@ -221,7 +221,8 @@ export WPT_PHP_EXECUTABLE=${WPT_PHP_EXECUTABLE-php} export WPT_PHPUNIT_CMD="" # (Optionally) define the command execution to remove the test directory -# Use if `rm -r` can't be called directly for some reason. +# Use if `rm -rf` can't be called directly for some reason. Include the `-f` +# flag, or removal stops to ask about write-protected files such as git objects. export WPT_RM_TEST_DIR_CMD="" # SSH connection string (can also be an alias). @@ -358,7 +359,7 @@ export WPT_PHPUNIT_CMD="" **Remove directory command** -(Optionally) define the command execution to remove the test directory. Use if `rm -r` can't be called directly for some reason. +(Optionally) define the command execution to remove the test directory. Use if `rm -rf` can't be called directly for some reason. Include the `-f` flag, or removal stops to ask about write-protected files such as git objects, and cleanup waits for input that never arrives. ``` export WPT_RM_TEST_DIR_CMD="" diff --git a/cleanup.php b/cleanup.php index dddc5fb..ed09326 100644 --- a/cleanup.php +++ b/cleanup.php @@ -37,13 +37,13 @@ * The following actions are performed: * - Forcefully deletes only the .git directory and the node_modules cache. * - Forcefully remove the `node_modules/.cache` directory. - * - Remove the entire preparation directory. + * - Forcefully remove the entire preparation directory. */ perform_operations( array( 'rm -rf ' . escapeshellarg( $runner_vars['WPT_PREPARE_DIR'] . '/.git' ), 'rm -rf ' . escapeshellarg( $runner_vars['WPT_PREPARE_DIR'] . '/node_modules/.cache' ), - 'rm -r ' . escapeshellarg( $runner_vars['WPT_PREPARE_DIR'] ), + 'rm -rf ' . escapeshellarg( $runner_vars['WPT_PREPARE_DIR'] ), ) ); diff --git a/functions.php b/functions.php index b8367c0..6291b48 100644 --- a/functions.php +++ b/functions.php @@ -87,7 +87,7 @@ function setup_runner_env_vars() { 'WPT_SSH_CONNECT' => trim( getenv( 'WPT_SSH_CONNECT' ) ), 'WPT_SSH_OPTIONS' => '' !== $ssh_options ? $ssh_options : '-o StrictHostKeyChecking=no', 'WPT_PHP_EXECUTABLE' => '' !== $php_exec ? $php_exec : 'php', - 'WPT_RM_TEST_DIR_CMD' => '' !== $rm_test_dir ? $rm_test_dir : 'rm -r ' . $runner_configuration['WPT_TEST_DIR'], + 'WPT_RM_TEST_DIR_CMD' => '' !== $rm_test_dir ? $rm_test_dir : 'rm -rf ' . escapeshellarg( $runner_configuration['WPT_TEST_DIR'] ), 'WPT_REPORT_API_KEY' => trim( getenv( 'WPT_REPORT_API_KEY' ) ), 'WPT_DEBUG' => (bool) getenv( 'WPT_DEBUG' ), )