Files
archived-migrations/build-phar.sh
Théo FIDRY 3af121d073 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.
2023-03-14 23:48:31 +01:00

20 lines
366 B
Bash
Executable File

#!/usr/bin/env bash
set -euf -o pipefail
./download-box.sh
function restorePlatform {
composer config --unset platform
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