Skip to content

Commit a67825b

Browse files
In copy_dir(), use cp -R on Mac, cp -r everywhere else (#183)
* In `copy_dir()`, use `cp -R` on Mac, `cp -r` everywhere else * Separate the shell command Co-authored-by: Alain Schlesser <[email protected]> --------- Co-authored-by: Alain Schlesser <[email protected]>
1 parent c2d228b commit a67825b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Context/FeatureContext.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,10 @@ public static function remove_dir( $dir ) {
824824
* Copy a directory (recursive). Destination directory must exist.
825825
*/
826826
public static function copy_dir( $src_dir, $dest_dir ) {
827-
Process::create( Utils\esc_cmd( 'cp -r %s/* %s', $src_dir, $dest_dir ) )->run_check();
827+
$shell_command = ( 'Darwin' === PHP_OS )
828+
? Utils\esc_cmd( 'cp -R %s/* %s', $src_dir, $dest_dir )
829+
: Utils\esc_cmd( 'cp -r %s/* %s', $src_dir, $dest_dir );
830+
Process::create( $shell_command )->run_check();
828831
}
829832

830833
public function add_line_to_wp_config( &$wp_config_code, $line ) {

0 commit comments

Comments
 (0)