Skip to content

Commit

Permalink
Print some debug messages like the checked out commit
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Oct 4, 2023
1 parent 6812e8a commit d22f967
Showing 1 changed file with 17 additions and 2 deletions.
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

0 comments on commit d22f967

Please sign in to comment.