Incorrect temp dir check on macOS
swissspidy opened this issue · comments
Pascal Birchler commented
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
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.