schildichat-desktop/generate_patches.sh
2024-08-07 08:21:27 +02:00

45 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
set -e
mydir="$(dirname "$(realpath "$0")")"
pushd "$mydir" > /dev/null
source ./merge_helpers.sh
persist_patches() {
local repo="$(realpath "$1")"
local patch_dir="$SCHILDI_ROOT/patches/$(basename "$1")"
if [ ! -d "$repo" ]; then
echo "Unknown repo: $repo"
return 1
fi
pushd "$repo"
if [ -d "$patch_dir" ]; then
echo "Clearing old patches..."
rm "$patch_dir"/*
else
echo "Creating new patch dir $patch_dir..."
mkdir "$patch_dir"
fi
echo "Creating new patches"
if [ "$1" = matrix-js-sdk ]; then
git format-patch -k v34.2.0.. -o "$patch_dir"
else
git format-patch -k upstream/master.. -o "$patch_dir"
fi
echo "Clearing automated commits from patches"
find "$patch_dir" -name "*-Automatic-package.json-adjustment.patch" -exec rm {} \;
find "$patch_dir" -name "*-Update-version-to-*.patch" -exec rm {} \;
popd
}
persist_patches element-desktop
#persist_patches element-web
persist_patches matrix-react-sdk
persist_patches matrix-js-sdk
popd > /dev/null