X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fconsolidation%2Fsite-alias%2F.scenarios.lock%2Finstall;fp=vendor%2Fconsolidation%2Fsite-alias%2F.scenarios.lock%2Finstall;h=16c69e107cce7f71e33e04207254d005200f9fd4;hp=0000000000000000000000000000000000000000;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/vendor/consolidation/site-alias/.scenarios.lock/install b/vendor/consolidation/site-alias/.scenarios.lock/install new file mode 100755 index 000000000..16c69e107 --- /dev/null +++ b/vendor/consolidation/site-alias/.scenarios.lock/install @@ -0,0 +1,57 @@ +#!/bin/bash + +SCENARIO=$1 +DEPENDENCIES=${2-install} + +# Convert the aliases 'highest', 'lowest' and 'lock' to +# the corresponding composer command to run. +case $DEPENDENCIES in + highest) + DEPENDENCIES=update + ;; + lowest) + DEPENDENCIES='update --prefer-lowest' + ;; + lock|default|"") + DEPENDENCIES=install + ;; +esac + +original_name=scenarios +recommended_name=".scenarios.lock" + +base="$original_name" +if [ -d "$recommended_name" ] ; then + base="$recommended_name" +fi + +# If scenario is not specified, install the lockfile at +# the root of the project. +dir="$base/${SCENARIO}" +if [ -z "$SCENARIO" ] || [ "$SCENARIO" == "default" ] ; then + SCENARIO=default + dir=. +fi + +# Test to make sure that the selected scenario exists. +if [ ! -d "$dir" ] ; then + echo "Requested scenario '${SCENARIO}' does not exist." + exit 1 +fi + +echo +echo "::" +echo ":: Switch to ${SCENARIO} scenario" +echo "::" +echo + +set -ex + +composer -n validate --working-dir=$dir --no-check-all --ansi +composer -n --working-dir=$dir ${DEPENDENCIES} --prefer-dist --no-scripts + +# If called from a CI context, print out some extra information about +# what we just installed. +if [[ -n "$CI" ]] ; then + composer -n --working-dir=$dir info +fi