Files
nextcloud-documentation/build/get-server-sources.sh
2023-09-21 15:05:33 +00:00

22 lines
536 B
Bash
Executable File

#!/bin/bash
#
# Clone Nextcloud server repo into $CWD/server
# if it already exists the latest commits from
# the specified branch will be fetched
NC_BRANCH="${1:-master}"
printf "\n\n"
echo Fetching source for $NC_BRANCH
printf "\n"
if [ -d server/.git ]; then
cd server
git remote set-branches --add origin $NC_BRANCH
git fetch --depth 1
git checkout $NC_BRANCH
git reset --hard origin/$NC_BRANCH
else
git clone https://github.com/nextcloud/server server --depth 1 --single-branch --branch $NC_BRANCH
fi;