-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.bash
38 lines (34 loc) · 830 Bytes
/
install.bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#! ~/bin/bash
# github username
GITHUB_UNAME=yardasol
# Set up local git branch
if [[ ! -d "$CODEPATH" ]]
then
echo "Cloing repository"
git clone --recurse-submodules [email protected]:$GITHUB_UNAME/$CODENAME $CODEPATH
cd $CODEPATH
git remote add upstream [email protected]:$ORGNAME/$CODENAME
fi
echo "Checking out tag or branch:"
cd $CODEPATH
git fetch upstream
if [[ ! $(git branch --list $BRANCH) ]]
then
if [[ $TAG ]]
then
git checkout tags/$TAG -b $BRANCH
else
git checkout upstream/$BRANCH
git switch -c $BRANCH
fi
else
git checkout $BRANCH
fi
git merge upstream/$BRANCH
git push --set-upstream origin $BRANCH
# Return to execution directory
cd $CURRENT
if [[ $INSTALLEXTRA -eq 1 ]]; then
echo "Installing extra stuff"
source $CODENAME/install-extra.bash
fi