Change from using exec to WP_CLI::Launch

exec does not seem to be available on all systems. Also makes the code
more consistent for running external processes.
parent 9063b3b7
......@@ -1293,7 +1293,7 @@ if ( ! defined( 'CIVICRM_WPCLI_LOADED' ) ) {
if ( $tarfile = $this->getOption( $option, false ) ) {
WP_CLI::launch( "gzip -d $tarfile" );
$tarfile = substr( $tarfile, 0, strlen( $tarfile ) - 3 );
$this->exec( "tar -xf $tarfile -C \"$destination_path\"" );
WP_CLI::launch( "tar -xf $tarfile -C \"$destination_path\"" );
return true;
} else {
return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment