2021-01-22 14:21:37 +01:00
|
|
|
#!/bin/bash
|
2019-04-12 16:13:28 +02:00
|
|
|
|
|
|
|
FEATURE_BRANCH=
|
|
|
|
|
2019-11-19 15:06:18 +01:00
|
|
|
# https://docs.travis-ci.com/user/environment-variables
|
2019-04-12 16:13:28 +02:00
|
|
|
|
2019-11-20 10:13:59 +01:00
|
|
|
if [ "$TRAVIS_TAG" != "" ] || [ "$TRAVIS_BRANCH" == "master" ]; then
|
2019-11-19 15:06:18 +01:00
|
|
|
exit 0;
|
|
|
|
fi
|
2019-04-12 16:13:28 +02:00
|
|
|
|
2019-11-19 15:06:18 +01:00
|
|
|
if [ "$TRAVIS_PULL_REQUEST_BRANCH" != "" ]; then
|
|
|
|
FEATURE_BRANCH="$TRAVIS_PULL_REQUEST_BRANCH";
|
|
|
|
else
|
|
|
|
FEATURE_BRANCH="$TRAVIS_BRANCH";
|
|
|
|
fi
|
2019-04-12 16:13:28 +02:00
|
|
|
|
2019-11-19 15:06:18 +01:00
|
|
|
echo "Attempting to install diagram-js@$FEATURE_BRANCH";
|
2019-04-12 16:13:28 +02:00
|
|
|
|
2019-11-19 15:06:18 +01:00
|
|
|
npm install "diagram-js@bpmn-io/diagram-js#$FEATURE_BRANCH";
|
|
|
|
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo "Falling back to diagram-js@develop";
|
|
|
|
|
|
|
|
npm install "diagram-js@bpmn-io/diagram-js#develop";
|
2019-11-20 10:13:59 +01:00
|
|
|
fi
|