mirror of
https://github.com/ONLYOFFICE/build_tools.git
synced 2026-04-07 14:06:31 +08:00
31 lines
586 B
Bash
Executable File
31 lines
586 B
Bash
Executable File
#!/bin/bash
|
|
SCRIPTPATH_FETCH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
|
|
|
REPO_NAME=$1
|
|
|
|
source ./scripts/config_value branch OO_BRANCH master
|
|
source ./scripts/config_value git-protocol OO_GIT_PR https
|
|
|
|
echo "$OO_BRANCH"
|
|
|
|
OO_REPO_URL="https://github.com/ONLYOFFICE/$REPO_NAME.git"
|
|
if [ "$OO_GIT_PR" == "ssh" ]
|
|
then
|
|
OO_REPO_URL="git@github.com:ONLYOFFICE/$REPO_NAME.git"
|
|
fi
|
|
|
|
curdir=$PWD
|
|
cd "$SCRIPTPATH_FETCH/../../"
|
|
|
|
if [ ! -d "./$REPO_NAME" ]
|
|
then
|
|
git clone "$OO_REPO_URL"
|
|
fi
|
|
|
|
cd "$REPO_NAME"
|
|
git fetch
|
|
git checkout -f $OO_BRANCH
|
|
git pull
|
|
|
|
cd "$curdir"
|