Skip to content

Commit b664f23

Browse files
committed
Resolve symbolic links for selfupdate
1 parent cf6cb35 commit b664f23

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Composer/Command/SelfUpdateCommand.php

+4
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ protected function execute(InputInterface $input, OutputInterface $output)
5252
$localFilename = realpath($_SERVER['argv'][0]) ?: $_SERVER['argv'][0];
5353
$tempFilename = dirname($localFilename) . '/' . basename($localFilename, '.phar').'-temp.phar';
5454

55+
while (is_link($localFilename)) {
56+
$localFilename = readlink($localFilename);
57+
}
58+
5559
$rfs->copy('getcomposer.org', $remoteFilename, $tempFilename);
5660

5761
if (!file_exists($tempFilename)) {

0 commit comments

Comments
 (0)