2019-04-12 14:13:28 +00:00
|
|
|
#! /bin/bash
|
|
|
|
|
|
|
|
FEATURE_BRANCH=
|
|
|
|
|
2019-11-19 14:06:18 +00:00
|
|
|
# https://docs.travis-ci.com/user/environment-variables
|
2019-04-12 14:13:28 +00:00
|
|
|
|
2019-11-20 09:13:59 +00:00
|
|
|
if [ "$TRAVIS_TAG" != "" ] || [ "$TRAVIS_BRANCH" == "master" ]; then
|
2019-11-19 14:06:18 +00:00
|
|
|
exit 0;
|
|
|
|
fi
|
2019-04-12 14:13:28 +00:00
|
|
|
|
2019-11-19 14:06:18 +00:00
|
|
|
if [ "$TRAVIS_PULL_REQUEST_BRANCH" != "" ]; then
|
|
|
|
FEATURE_BRANCH="$TRAVIS_PULL_REQUEST_BRANCH";
|
|
|
|
else
|
|
|
|
FEATURE_BRANCH="$TRAVIS_BRANCH";
|
|
|
|
fi
|
2019-04-12 14:13:28 +00:00
|
|
|
|
2019-11-19 14:06:18 +00:00
|
|
|
echo "Attempting to install diagram-js@$FEATURE_BRANCH";
|
2019-04-12 14:13:28 +00:00
|
|
|
|
2019-11-19 14:06:18 +00: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 09:13:59 +00:00
|
|
|
fi
|