Skip to content

Commit

Permalink
Allow for temp folder to be prefixed with /private (#68)
Browse files Browse the repository at this point in the history
Allow for temp folder to be prefixed with `/private`
  • Loading branch information
schlessera authored Jun 13, 2019
2 parents 44024bf + 4b7e74b commit 8a004e9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion features/steps/given.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ function ( $world, $empty_or_nonexistent, $dir ) {

$temp_dir = sys_get_temp_dir();

if ( 0 !== strpos( $dir, $temp_dir ) ) {
// Also check for temp dir prefixed with `/private` for Mac OS X.
if ( 0 !== strpos( $dir, $temp_dir ) && 0 !== strpos( $dir, "/private{$temp_dir}" ) ) {
throw new RuntimeException( sprintf( "Attempted to delete directory '%s' that is not in the temp directory '%s'. " . __FILE__ . ':' . __LINE__, $dir, $temp_dir ) );
}

Expand Down

0 comments on commit 8a004e9

Please sign in to comment.