make git_apply_patch work for apps as well (#2570)

This commit is contained in:
Daniel Hansson 2023-09-29 14:12:10 +02:00 committed by GitHub
parent 9f58a31495
commit dc7017891a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

10
lib.sh
View File

@ -1847,10 +1847,14 @@ printf "%b%s%b\n" "$1" "$2" "$Color_Off"
}
# Apply patch
# git_apply_patch 15992 server 16.0.2
# App:
# git_apply_patch "319" "fulltextsearch_elasticsearch" "27.1.1" "$NCPATH/apps/fulltextsearch_elasticsearch"
# Server:
# git_apply_patch "15992" "server" "16.0.2" "$NCPATH"
# 1 = pull
# 2 = repository
# Nextcloud version
# 3 = Nextcloud version
# 4 = Folder on system
git_apply_patch() {
if [ -z "$NCVERSION" ]
then
@ -1860,7 +1864,7 @@ if [[ "$CURRENTVERSION" = "$3" ]]
then
curl_to_dir "https://patch-diff.githubusercontent.com/raw/nextcloud/${2}/pull" "${1}.patch" "/tmp"
install_if_not git
cd "$NCPATH"
cd "${4}"
if git apply --check /tmp/"${1}".patch >/dev/null 2>&1
then
print_text_in_color "$IGreen" "Applying patch https://github.com/nextcloud/${2}/pull/${1} ..."