build.sh: Update branch.
parent
e846674a2f
commit
93a358038d
9
build.sh
9
build.sh
|
@ -462,8 +462,9 @@ update_script_name() {
|
||||||
update_script() {
|
update_script() {
|
||||||
update_script=`update_script_name`
|
update_script=`update_script_name`
|
||||||
bash_path=`which bash`
|
bash_path=`which bash`
|
||||||
|
branch=$(current_git_branch)
|
||||||
$ECHO "#!$bash_path" >"$update_script"
|
$ECHO "#!$bash_path" >"$update_script"
|
||||||
$ECHO "git pull \"$GIT_URL\" master" >>"$update_script"
|
$ECHO "git pull \"$GIT_URL\" ${branch}" >>"$update_script"
|
||||||
$ECHO "if [[ \$? -eq 0 ]]; then exec \"$0\" $SCRIPT_ARGS; else echo \"git pull failed\"; exit 2; fi" \
|
$ECHO "if [[ \$? -eq 0 ]]; then exec \"$0\" $SCRIPT_ARGS; else echo \"git pull failed\"; exit 2; fi" \
|
||||||
>>"$update_script"
|
>>"$update_script"
|
||||||
$ECHO "exit 0" >>"$update_script"
|
$ECHO "exit 0" >>"$update_script"
|
||||||
|
@ -478,16 +479,18 @@ update_script_changed() {
|
||||||
|
|
||||||
git_fetch_factorcode() {
|
git_fetch_factorcode() {
|
||||||
$ECHO "Fetching the git repository from factorcode.org..."
|
$ECHO "Fetching the git repository from factorcode.org..."
|
||||||
|
branch=$(current_git_branch)
|
||||||
|
|
||||||
rm -f `update_script_name`
|
rm -f `update_script_name`
|
||||||
invoke_git fetch "$GIT_URL" master
|
invoke_git fetch --all
|
||||||
|
invoke_git fetch --tags
|
||||||
|
|
||||||
if update_script_changed; then
|
if update_script_changed; then
|
||||||
$ECHO "Updating and restarting the build.sh script..."
|
$ECHO "Updating and restarting the build.sh script..."
|
||||||
update_script
|
update_script
|
||||||
else
|
else
|
||||||
$ECHO "Updating the working tree..."
|
$ECHO "Updating the working tree..."
|
||||||
invoke_git pull "$GIT_URL" master
|
invoke_git pull "$GIT_URL" "${branch}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue