Re-enable auto-commit for icons and theme

This commit is contained in:
SpiritCroc 2024-10-06 16:52:56 +02:00
parent ebc3498510
commit 4c8f9de4e8
5 changed files with 50 additions and 10 deletions

View File

@ -4,22 +4,37 @@ set -e
mydir="$(dirname "$(realpath "$0")")"
print_section() {
local msg="$1"
echo "##############################################################"
echo "# $msg"
echo "##############################################################"
}
pushd "$mydir" > /dev/null
source ./merge_helpers.sh
# Apply our patches
print_section "Apply patches to matrix-js-sdk"
apply_patches matrix-js-sdk
print_section "Apply patches to matrix-react-sdk"
apply_patches matrix-react-sdk
#print_section "Apply patches to element-web"
#apply_patches element-web
print_section "Apply patches to element-desktop"
apply_patches element-desktop
# Automatic adjustments
#print_section "Apply i18n"
#automatic_i18n_adjustment
print_section "Apply automatic package adjustments"
automatic_packagejson_adjustment
# Automatic theme and icon update
print_section "Apply automatic theme updates"
./theme.sh y
./graphics/icon_gen.sh
print_section "Generate icons"
./graphics/icon_gen.sh y
popd > /dev/null

View File

@ -1,6 +1,16 @@
#!/bin/bash
set -e
mydir="$(dirname "$(realpath "$0")")"
automatic_commit="$1"
SCHILDI_ROOT="$mydir/.."
source "$SCHILDI_ROOT/merge_helpers.sh"
if [[ "$automatic_commit" == [Yy]* ]]; then
forelement_repos check_clean_git
fi
export_rect() {
@ -17,7 +27,7 @@ export_square() {
export_rect "$1" "$size" "$in" "$out"
}
repo_dir="$mydir/../element-web"
repo_dir="$SCHILDI_ROOT/element-web"
base_out="$repo_dir/res/vector-icons"
for i in 1024 120 150 152 180 24 300 44 48 50 76 88; do
@ -45,7 +55,7 @@ for f in "$base_out"/*.png; do
done
repo_dir="$mydir/../element-desktop"
repo_dir="$SCHILDI_ROOT/element-desktop"
base_out="$repo_dir/res/img"
export_square 256 "$mydir/ic_launcher_sc.svg" "$base_out/element.png"
@ -77,3 +87,8 @@ rm "$base_out/icons/1024x1024.png"
for f in "$base_out/icons"/*.png; do
pngcrush -ow "$f"
done
if [[ "$automatic_commit" == [Yy]* ]]; then
forelement_repos commit_if_dirty "Automatic icon update"
fi

View File

@ -1,6 +1,8 @@
#!/bin/bash
SCHILDI_ROOT="$(dirname "$(realpath "$0")")"
if [ -z "$SCHILDI_ROOT" ]; then
SCHILDI_ROOT="$(dirname "$(realpath "$0")")"
fi
branch=${BRANCH:-"lite"}
@ -290,3 +292,10 @@ on_apply_patch_fail() {
echo "----------------------------------"
read -p "Press enter after committing resolved conflicts: "
}
commit_if_dirty() {
local message="$1"
# see: https://devops.stackexchange.com/a/5443
git add -A
git diff-index --quiet HEAD || git commit -m "$message"
}

View File

@ -52,6 +52,7 @@ popd > /dev/null
# Refresh environment
make clean
make setup
forall_repos commit_if_dirty "Automatic setup commit"
./apply_patches.sh

View File

@ -172,10 +172,10 @@ for f in res/**/*.svg; do
replace_colors "$f"
done
popd > /dev/null
if [[ "$automatic_commit" == [Yy]* ]]; then
# see: https://devops.stackexchange.com/a/5443
git add -A
git diff-index --quiet HEAD || git commit -m "Automatic theme update"
fi
#if [[ "$automatic_commit" == [Yy]* ]]; then
# # see: https://devops.stackexchange.com/a/5443
# git add -A
# git diff-index --quiet HEAD || git commit -m "Automatic theme update"
#fi
popd > /dev/null