From 34afe55b5c5746f840652d6a230a95c4ff6813c7 Mon Sep 17 00:00:00 2001 From: SpiritCroc Date: Wed, 2 Sep 2020 13:15:16 +0200 Subject: [PATCH] alternative_package.sh: Don't run twice Change-Id: I83295b2e68d3610667e257cbde91715937f626b7 --- alternative_package.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/alternative_package.sh b/alternative_package.sh index f26a5ae28e..1525367b5f 100755 --- a/alternative_package.sh +++ b/alternative_package.sh @@ -11,6 +11,15 @@ if [ -z "$package_add" ] || [ -z "$name_add" ]; then exit 1 fi +build_gradle="$mydir/vector/build.gradle" +src_dir="$mydir/vector/src" +fastlane_dir="$mydir/fastlane" + +if grep -q "de.spiritcroc.riotx.$package_add" "$build_gradle"; then + echo "Abort, $package_add already active" + exit 0 +fi + logo_replace_color() { local file="$1" local color_shell="$2" @@ -54,9 +63,6 @@ case "$package_add" in ;; esac -build_gradle="$mydir/vector/build.gradle" -src_dir="$mydir/vector/src" -fastlane_dir="$mydir/fastlane" 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|SchildiChat|SchildiChat.$name_add|g" `find "$fastlane_dir/metadata/android" -name "title.txt"`