Skip to content

Commit 8a004e9

Browse files
authored
Allow for temp folder to be prefixed with /private (#68)
Allow for temp folder to be prefixed with `/private`
2 parents 44024bf + 4b7e74b commit 8a004e9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

features/steps/given.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ function ( $world, $empty_or_nonexistent, $dir ) {
2424

2525
$temp_dir = sys_get_temp_dir();
2626

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

0 commit comments

Comments
 (0)