-
Notifications
You must be signed in to change notification settings - Fork 27
Normalize temp dir in Given a directory step
#329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,9 +53,13 @@ public function given_a_specific_directory( $empty_or_nonexistent, $dir ): void | |
| // Mac OS X can prefix the `/var` folder to turn it into `/private/var`. | ||
| $dir = preg_replace( '|^/private/var/|', '/var/', $dir ); | ||
|
|
||
| $temp_dir = Path::normalize( sys_get_temp_dir() ); | ||
| $temp_dir = realpath( sys_get_temp_dir() ); | ||
| $temp_dir = $temp_dir ? Path::normalize( $temp_dir ) : Path::normalize( sys_get_temp_dir() ); | ||
swissspidy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| $dir = Path::normalize( $dir ); | ||
|
|
||
| // Also normalize temp dir for Mac OS X. | ||
| $temp_dir = preg_replace( '|^/private/var/|', '/var/', $temp_dir ); | ||
swissspidy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
|
Comment on lines
+56
to
+62
|
||
| // Also check for temp dir prefixed with `/private` for Mac OS X. | ||
| if ( 0 !== strpos( $dir, $temp_dir ) && 0 !== strpos( $dir, "/private{$temp_dir}" ) ) { | ||
|
Comment on lines
63
to
64
|
||
| throw new RuntimeException( | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.