2021-10-21 10:03:21 +02:00
# ! /bin/sh
2021-10-22 09:57:47 +02:00
TRAVIS_BRANCH = algebraic-geometry
2021-10-21 10:03:21 +02:00
rm -rf LatexPackagesBuild
git clone https://github.com/kesslermaximilian/LatexPackagesBuild.git LatexPackagesBuild
cd LatexPackagesBuild
2021-10-22 09:57:47 +02:00
REMOTE_BRANCH = $( git branch -a | sed -n '/remotes\/origin\/.*-build/p' | sed 's/remotes\/origin\///g' | sed 's/-build//g' | sed 's/[[:space:]]//g' | sed -n " /^ ${ TRAVIS_BRANCH } $/p " )
2021-10-21 10:03:21 +02:00
2021-10-22 09:57:47 +02:00
echo ${ REMOTE_BRANCH }
2021-10-21 10:03:21 +02:00
2021-10-22 09:57:47 +02:00
if [ " $REMOTE_BRANCH " = "" ] ; then
2021-10-21 10:03:21 +02:00
git checkout --orphan ${ TRAVIS_BRANCH } -build
ls -ra | sed '/^\.git$/d' | sed '/^\.\.$/d' | sed '/^\.$/d' | xargs -r git rm --cached
ls -ra | sed '/^\.git$/d' | sed '/^\.\.$/d' | sed '/^\.$/d' | xargs -r rm -rf
else
echo "found"
2021-10-22 09:57:47 +02:00
git checkout -b ${ REMOTE_BRANCH } -build origin/${ REMOTE_BRANCH } -build
2021-10-21 10:03:21 +02:00
fi