diff --git a/src/Composer/Command/SelfUpdateCommand.php b/src/Composer/Command/SelfUpdateCommand.php index e8c373197..4074d8bad 100644 --- a/src/Composer/Command/SelfUpdateCommand.php +++ b/src/Composer/Command/SelfUpdateCommand.php @@ -49,8 +49,8 @@ EOT $localFilename = realpath($_SERVER['argv'][0]) ?: $_SERVER['argv'][0]; // Check if current dir is writable and if not try the cache dir from settings - $tmpDir = is_writable(dirname($localFilename))? dirname($localFilename) . '/' : $cacheDir; - $tempFilename = $tmpDir . basename($localFilename, '.phar').'-temp.phar'; + $tmpDir = is_writable(dirname($localFilename))? dirname($localFilename) : $cacheDir; + $tempFilename = $tmpDir . '/' . basename($localFilename, '.phar').'-temp.phar'; // check for permissions in local filesystem before start connection process if (!is_writable($tmpDir)) {