mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-12 06:15:28 +03:00
135a0884c9
Co-Authored-By: turt2live <travpc@gmail.com>
25 lines
582 B
Bash
Executable file
25 lines
582 B
Bash
Executable file
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
org="$1"
|
|
repo="$2"
|
|
defbranch="$3"
|
|
|
|
[ -z "$defbranch" ] && defbranch="develop"
|
|
|
|
rm -r "$repo" || true
|
|
|
|
curbranch="$TRAVIS_PULL_REQUEST_BRANCH"
|
|
[ -z "$curbranch" ] && curbranch="$TRAVIS_BRANCH"
|
|
[ -z "$curbranch" ] && curbranch=`"echo $GIT_BRANCH" | sed -e 's/^origin\///'` # jenkins
|
|
|
|
if [ -n "$curbranch" ]
|
|
then
|
|
echo "Determined branch to be $curbranch"
|
|
|
|
git clone https://github.com/$org/$repo.git $repo --branch "$curbranch" && exit 0
|
|
fi
|
|
|
|
echo "Checking out default branch $defbranch"
|
|
git clone https://github.com/$org/$repo.git $repo --branch $defbranch
|