Files
nextcloud-docs/build/get-server-sources.sh
John Molakvoæ (skjnldsv) e9b56bcb89 Properly pass the branch to get-server-sources.sh
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2018-12-07 15:50:03 +01:00

18 lines
436 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 fetch && git checkout $NC_BRANCH && git reset --hard origin/$NC_BRANCH
else
git clone https://github.com/nextcloud/server server --depth 1
fi;