mirror of
https://github.com/doctrine/migrations.git
synced 2026-03-23 22:42:14 +01:00
build: Fix cleanup of the backup composer lock file
The trap function was registered as the last bash instruction and as a result was not executed if anything failed before, e.g. the composer update command or building the PHAR itself. In the event the build PHAR script fails, the temporary backup composer.lock file may be created and not removed.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -6,6 +6,7 @@ dist/
|
||||
tests/phpunit.xml
|
||||
vendor/
|
||||
/composer.lock
|
||||
/composer.lock.back
|
||||
phpunit.xml
|
||||
/.phpunit.result.cache
|
||||
/phpcs.xml
|
||||
|
||||
@@ -9,11 +9,11 @@ function restorePlatform {
|
||||
mv -f composer.lock.back composer.lock || true
|
||||
}
|
||||
|
||||
trap restorePlatform exit
|
||||
|
||||
# lock PHP to minimum allowed version
|
||||
composer config platform.php 7.2.0
|
||||
cp composer.lock composer.lock.back || true
|
||||
composer update
|
||||
|
||||
php box.phar compile -vv
|
||||
|
||||
trap restorePlatform exit
|
||||
|
||||
Reference in New Issue
Block a user