Skip to content

Commit

Permalink
In copy_dir(), use cp -R on Mac, cp -r everywhere else (#183)
Browse files Browse the repository at this point in the history
* In `copy_dir()`, use `cp -R` on Mac, `cp -r` everywhere else

* Separate the shell command

Co-authored-by: Alain Schlesser <alain.schlesser@gmail.com>

---------

Co-authored-by: Alain Schlesser <alain.schlesser@gmail.com>
  • Loading branch information
danielbachhuber and schlessera authored Oct 18, 2023
1 parent c2d228b commit a67825b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Context/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,10 @@ public static function remove_dir( $dir ) {
* Copy a directory (recursive). Destination directory must exist.
*/
public static function copy_dir( $src_dir, $dest_dir ) {
Process::create( Utils\esc_cmd( 'cp -r %s/* %s', $src_dir, $dest_dir ) )->run_check();
$shell_command = ( 'Darwin' === PHP_OS )
? Utils\esc_cmd( 'cp -R %s/* %s', $src_dir, $dest_dir )
: Utils\esc_cmd( 'cp -r %s/* %s', $src_dir, $dest_dir );
Process::create( $shell_command )->run_check();
}

public function add_line_to_wp_config( &$wp_config_code, $line ) {
Expand Down

0 comments on commit a67825b

Please sign in to comment.