Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / g1a / composer-test-scenarios / scripts / install-scenario
1 #!/bin/bash
2
3 SCENARIO=$1
4 DEPENDENCIES=${2-install}
5
6 # Convert the aliases 'highest', 'lowest' and 'lock' to
7 # the corresponding composer command to run.
8 case $DEPENDENCIES in
9   highest)
10     DEPENDENCIES=update
11     ;;
12   lowest)
13     DEPENDENCIES='update --prefer-lowest'
14     ;;
15   lock|default|"")
16     DEPENDENCIES=install
17     ;;
18 esac
19
20 original_name=scenarios
21 recommended_name=".scenarios.lock"
22
23 base="$original_name"
24 if [ -d "$recommended_name" ] ; then
25   base="$recommended_name"
26 fi
27
28 # If scenario is not specified, install the lockfile at
29 # the root of the project.
30 dir="$base/${SCENARIO}"
31 if [ -z "$SCENARIO" ] || [ "$SCENARIO" == "default" ] ; then
32   SCENARIO=default
33   dir=.
34 fi
35
36 # Test to make sure that the selected scenario exists.
37 if [ ! -d "$dir" ] ; then
38   echo "Requested scenario '${SCENARIO}' does not exist."
39   exit 1
40 fi
41
42 echo
43 echo "::"
44 echo ":: Switch to ${SCENARIO} scenario"
45 echo "::"
46 echo
47
48 set -ex
49
50 composer -n validate --working-dir=$dir --no-check-all --ansi
51 composer -n --working-dir=$dir ${DEPENDENCIES} --prefer-dist --no-scripts
52
53 # If called from a CI context, print out some extra information about
54 # what we just installed.
55 if [[ -n "$CI" ]] ; then
56   composer -n --working-dir=$dir info
57 fi