File tree Expand file tree Collapse file tree 1 file changed +1
-6
lines changed Expand file tree Collapse file tree 1 file changed +1
-6
lines changed Original file line number Diff line number Diff line change @@ -12,24 +12,19 @@ echo "Installing Symfony version $1"
12
12
# This is not required for CI, but it allows to test the script locally
13
13
function cleanup {
14
14
echo " Cleaning up"
15
- # Restore the original composer.json file
16
15
mv composer.origin.json composer.json
17
16
}
18
17
19
18
function install-specified-symfony-version {
20
19
local symfony_version=$1
21
- # Save the original composer.json file
22
20
cp composer.json composer.origin.json
23
- # Delete the lock file and vendor directory for a clean install
24
21
rm composer.lock || true
25
22
rm -Rf vendor || true
26
- # Replace the Symfony version in composer.json
27
23
sed -i ' s/\^5.4 || \^6.0 || \^7.0/\^' $symfony_version ' /g' composer.json
28
- # Install the specified Symfony version
29
24
composer install
30
25
}
31
26
32
- # Ensure cleanup is called on exit
27
+ # Ensure cleanup is called on exit. Handles both success and failure exits
33
28
trap cleanup EXIT
34
29
35
30
install-specified-symfony-version $1
You can’t perform that action at this time.
0 commit comments