alternative_package.sh: Auto-commit, check, if git is clean

Change-Id: Ieae93761dc51c1c141d138a34c6ae01dfef557d2
This commit is contained in:
SpiritCroc 2020-11-05 16:11:32 +01:00
parent 4a483986f0
commit 54b9cbd653
1 changed files with 7 additions and 0 deletions

View File

@ -6,11 +6,15 @@ package_add="$1"
name_add="$2" name_add="$2"
mydir="$(dirname "$(realpath "$0")")" mydir="$(dirname "$(realpath "$0")")"
source "$mydir/merge_helpers.sh"
if [ -z "$package_add" ] || [ -z "$name_add" ]; then if [ -z "$package_add" ] || [ -z "$name_add" ]; then
echo "Usage: $0 <package_add> <name_add>" echo "Usage: $0 <package_add> <name_add>"
exit 1 exit 1
fi fi
require_clean_git
build_gradle="$mydir/vector/build.gradle" build_gradle="$mydir/vector/build.gradle"
src_dir="$mydir/vector/src" src_dir="$mydir/vector/src"
fastlane_dir="$mydir/fastlane" fastlane_dir="$mydir/fastlane"
@ -75,3 +79,6 @@ esac
sed -i "s|SchildiChat|SchildiChat.$name_add|g" "$build_gradle" sed -i "s|SchildiChat|SchildiChat.$name_add|g" "$build_gradle"
sed -i "s|de.spiritcroc.riotx|de.spiritcroc.riotx.$package_add|g" "$build_gradle" `find "$src_dir" -name google-services.json` sed -i "s|de.spiritcroc.riotx|de.spiritcroc.riotx.$package_add|g" "$build_gradle" `find "$src_dir" -name google-services.json`
sed -i "s|SchildiChat|SchildiChat.$name_add|g" `find "$fastlane_dir/metadata/android" -name "title.txt"` sed -i "s|SchildiChat|SchildiChat.$name_add|g" `find "$fastlane_dir/metadata/android" -name "title.txt"`
git add -A
git commit -m "Switch to alternative $name_add ($package_add)"