Allow overriding self-update target file with envvar COMPOSER_SELF_UPDATE_TARGET
Useful if Composer is provided on a read-only filesystems, to allow self-update to work with a different destinationpull/8151/head
parent
de8368af45
commit
faa7c5eea2
|
@ -351,6 +351,10 @@ TAGSPUBKEY
|
||||||
@copy($localFilename, $backupTarget);
|
@copy($localFilename, $backupTarget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($targetFilename = getenv('COMPOSER_SELF_UPDATE_TARGET')) {
|
||||||
|
$localFilename = realpath($targetFilename) ?: $targetFilename;
|
||||||
|
}
|
||||||
|
|
||||||
rename($newFilename, $localFilename);
|
rename($newFilename, $localFilename);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Reference in New Issue