mirror of
https://github.com/SchildiChat/schildichat-desktop.git
synced 2025-04-01 21:44:28 +02:00
Add helpers for overlaying package.json
This commit is contained in:
parent
312b0ef380
commit
8ecdbb82b0
@ -90,15 +90,15 @@ automatic_i18n_reversion() {
|
|||||||
local skip_commit="$1"
|
local skip_commit="$1"
|
||||||
|
|
||||||
pushd "$SCHILDI_ROOT/matrix-react-sdk" > /dev/null
|
pushd "$SCHILDI_ROOT/matrix-react-sdk" > /dev/null
|
||||||
revert_i18n_changes "$i18n_path" $skip_commit
|
revert_i18n_changes "$i18n_path" "$skip_commit"
|
||||||
popd > /dev/null
|
popd > /dev/null
|
||||||
|
|
||||||
pushd "$SCHILDI_ROOT/element-web" > /dev/null
|
pushd "$SCHILDI_ROOT/element-web" > /dev/null
|
||||||
revert_i18n_changes "$i18n_path" $skip_commit
|
revert_i18n_changes "$i18n_path" "$skip_commit"
|
||||||
popd > /dev/null
|
popd > /dev/null
|
||||||
|
|
||||||
pushd "$SCHILDI_ROOT/element-desktop" > /dev/null
|
pushd "$SCHILDI_ROOT/element-desktop" > /dev/null
|
||||||
revert_i18n_changes "$i18n_path" $skip_commit
|
revert_i18n_changes "$i18n_path" "$skip_commit"
|
||||||
popd > /dev/null
|
popd > /dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -124,3 +124,50 @@ automatic_i18n_adjustment() {
|
|||||||
apply_i18n_changes "$i18n_path"
|
apply_i18n_changes "$i18n_path"
|
||||||
popd > /dev/null
|
popd > /dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
revert_packagejson_changes() {
|
||||||
|
local path="$1"
|
||||||
|
local skip_commit="$2"
|
||||||
|
|
||||||
|
git checkout upstream/master -- "$path"
|
||||||
|
|
||||||
|
if [[ "$skip_commit" != [Yy]* ]]; then
|
||||||
|
git commit -m "Automatic package.json reversion" || true
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
apply_packagejson_overlay() {
|
||||||
|
local orig_path="$1"
|
||||||
|
local overlay_path="$2"
|
||||||
|
|
||||||
|
# see: https://stackoverflow.com/a/24904276
|
||||||
|
new_content=`jq -s '.[0] * .[1]' "$orig_path" "$overlay_path"`
|
||||||
|
|
||||||
|
echo "$new_content" > "$orig_path"
|
||||||
|
git add "$orig_path"
|
||||||
|
git commit -m "Automatic package.json adjustment" || true
|
||||||
|
}
|
||||||
|
|
||||||
|
automatic_packagejson_reversion() {
|
||||||
|
local skip_commit="$1"
|
||||||
|
|
||||||
|
pushd "$SCHILDI_ROOT/element-web" > /dev/null
|
||||||
|
revert_packagejson_changes "package.json" "$skip_commit"
|
||||||
|
popd > /dev/null
|
||||||
|
|
||||||
|
pushd "$SCHILDI_ROOT/element-desktop" > /dev/null
|
||||||
|
revert_packagejson_changes "package.json" "$skip_commit"
|
||||||
|
popd > /dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
automatic_packagejson_adjustment() {
|
||||||
|
# element-web
|
||||||
|
pushd "$SCHILDI_ROOT/element-web" > /dev/null
|
||||||
|
apply_packagejson_overlay "package.json" "overlay-package.json"
|
||||||
|
popd > /dev/null
|
||||||
|
|
||||||
|
# element-desktop
|
||||||
|
pushd "$SCHILDI_ROOT/element-desktop" > /dev/null
|
||||||
|
apply_packagejson_overlay "package.json" "overlay-package.json"
|
||||||
|
popd > /dev/null
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user