Skip to content

Commit dc6efd0

Browse files
committed
up: support parse ~ as homedir on windows
1 parent 3f7a96d commit dc6efd0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Traits/FileSystemFuncTrait.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,12 @@ public static function realpath(string $path): string
175175
$start = '';
176176
$isUnix = DIRECTORY_SEPARATOR === '/';
177177
if ($isUnix) {
178-
// ~: is user home dir in *nix OS
179-
if ($parts[0] === '~') {
180-
$parts[0] = OS::getUserHomeDir();
181-
} else {
182-
$start = '/';
183-
}
178+
$start = '/';
179+
}
180+
181+
// ~: is user home dir in *nix OS
182+
if ($parts[0] === '~') {
183+
$parts[0] = OS::getUserHomeDir();
184184
}
185185

186186
$absolutes = [];

0 commit comments

Comments
 (0)