-
Notifications
You must be signed in to change notification settings - Fork 27
Closed
Labels
Description
I'm running macOS High Sierra (10.13) and PHP 7.2.6 (installed via Homebrew).
I noticed in wp-cli/language-command#38 that on macOS the following check always fails:
wp-cli-tests/features/steps/given.php
Lines 21 to 23 in e434d14
| if ( 0 !== strpos( $dir, sys_get_temp_dir() ) ) { | |
| throw new RuntimeException( sprintf( "Attempted to delete directory '%s' that is not in the temp directory '%s'. " . __FILE__ . ':' . __LINE__, $dir, sys_get_temp_dir() ) ); | |
| } |
In my case, sys_get_temp_dir() points to /private/var/some-path-to-wp-cli.../.
$dir on the other hand points to /var/some-path-to-wp-cli.../. That's why I get an exception every time.
However, on macOS, /var is a symlink to /private/var though, so these paths are actually equal.
To solve this, realpath() needs to be used to resolve the symlinks before comparing the paths.
PR imminent.
Reactions are currently unavailable