Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,17 @@ init_git() {
# Detect local changes
# Return 0 if changes are detected, 1 otherwise
detect_changes() {
echo "Detecting changes"
echo ""
git diff --name-only
echo ""

if git diff --quiet HEAD --; then
echo "no changes detected"
echo -e "\033[1;35m🏳️ No changes detected\033[0m"
return 1
fi
echo "changes detected"
echo -e "\033[1;33m🛠️ Changes detected\033[0m"
echo ""
}

# Create and push a new commit with updated sources
Expand Down Expand Up @@ -61,10 +67,19 @@ if ! [[ "$CURRENT_BRANCH" =~ ^(stable[1-9][0-9]+|master|main)$ ]]; then
fi

echo "Updating OCP from branch: $CURRENT_BRANCH"
echo ""

# Load server repository
[ -d server ] && rm -rf server
echo "git clone --depth 1 --branch $CURRENT_BRANCH https://github.com/nextcloud/server.git"
git clone --depth 1 --branch "$CURRENT_BRANCH" https://github.com/nextcloud/server.git
echo ""

# Print last commit
pushd server
git log
echo ""
popd

# Init git user and push remote
init_git
Expand Down