diff --git a/scripts/change-app.sh b/scripts/change-app.sh index 03ab890..2e23146 100755 --- a/scripts/change-app.sh +++ b/scripts/change-app.sh @@ -1,21 +1,23 @@ #!/bin/bash PROJECT_DIR="" -if [ -n "${CI_PROJECT_DIR}" ]; then - PROJECT_DIR="${CI_PROJECT_DIR}" +if [ -n "${GITHUB_WORKSPACE}" ]; then + PROJECT_DIR="${GITHUB_WORKSPACE}" else PROJECT_DIR=$(dirname "$PWD") fi FILE="$PROJECT_DIR/build.gradle.kts" +echo "Project Directory: $PROJECT_DIR" + # shellcheck disable=SC2120 update_app_keys() { CI_TAPSELL_APP_ID="$1" CI_ADMOB_APP_ID="$2" CI_APPLOVIN_APP_ID="$3" - echo "Updating Tapsell App Keys to the new app: TapsellAppId: $CI_TAPSELL_APP_ID - AdmobAppId: $CI_ADMOB_APP_ID - ApplovinAppId: $CI_APPLOVIN_APP_ID" + echo "Updating Tapsell App Keys: TapsellAppId: $CI_TAPSELL_APP_ID - AdmobAppId: $CI_ADMOB_APP_ID - ApplovinAppId: $CI_APPLOVIN_APP_ID" if [ -n "$CI_TAPSELL_APP_ID" ] && [ -n "$CI_ADMOB_APP_ID" ] && [ -n "$CI_APPLOVIN_APP_ID" ]; then sed -i '' -e "s/const val TAPSELL_APP_ID.*/const val TAPSELL_APP_ID = \"$CI_TAPSELL_APP_ID\"/" "$FILE"