-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
# Set default mode to prod if not specified | ||
MODE=${1:-prod} | ||
|
||
# Select and export providers based on mode | ||
if [ "$MODE" = "test" ]; then | ||
if [ -z "$ORCHID_GENAI_FRONTEND_PROVIDERS_TEST" ]; then | ||
echo "Error: ORCHID_GENAI_FRONTEND_PROVIDERS_TEST environment variable not set" | ||
exit 1 | ||
fi | ||
export PROVIDERS="$ORCHID_GENAI_FRONTEND_PROVIDERS_TEST" | ||
else | ||
if [ -z "$ORCHID_GENAI_FRONTEND_PROVIDERS_PROD" ]; then | ||
echo "Error: ORCHID_GENAI_FRONTEND_PROVIDERS_PROD environment variable not set" | ||
exit 1 | ||
fi | ||
export PROVIDERS="$ORCHID_GENAI_FRONTEND_PROVIDERS_PROD" | ||
fi | ||
|
||
BUILD_CMD="flutter build web --dart-define=PROVIDERS='$PROVIDERS'" | ||
echo "Executing: $BUILD_CMD" | ||
eval "$BUILD_CMD" | ||
|
||
# Clean up | ||
unset PROVIDERS | ||
|
||
# Exit with flutter's exit code | ||
exit $? |