Skip to content

Commit

Permalink
Merge pull request #38953 from Expensify/Rory-InjectDesktopGCPKey
Browse files Browse the repository at this point in the history
make gcp environment variable available to electron main process

(cherry picked from commit 5cc5347)
  • Loading branch information
Hayata Suenaga authored and OSBotify committed Mar 25, 2024
1 parent d46b530 commit cf91886
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion scripts/build-desktop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,18 @@ else
ENV_FILE=".env"
fi

if [[ -n "$GCP_GEOLOCATION_API_KEY" ]]; then
if grep -qE "^GCP_GEOLOCATION_API_KEY=" "$ENV_FILE"; then
# Replace the value for the existing key
sed -i "s|^GCP_GEOLOCATION_API_KEY=.*$|GCP_GEOLOCATION_API_KEY=$GCP_GEOLOCATION_API_KEY|g" "$ENV_FILE"
else
# Add the key-value pair to the config file
echo "GCP_GEOLOCATION_API_KEY=$GCP_GEOLOCATION_API_KEY" >> "$ENV_FILE"
fi
fi

SCRIPTS_DIR=$(dirname "${BASH_SOURCE[0]}")
source "$SCRIPTS_DIR/shellUtils.sh";
source "$SCRIPTS_DIR/shellUtils.sh"

title "Bundling Desktop js Bundle Using Webpack"
info " • ELECTRON_ENV: $ELECTRON_ENV"
Expand Down

0 comments on commit cf91886

Please sign in to comment.