-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·30 lines (24 loc) · 851 Bytes
/
setup.sh
File metadata and controls
executable file
·30 lines (24 loc) · 851 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
# Usage:
# ./setup.sh [prod]
# This script creates a .env file in ./apps/docs used by the Docusaurus app to determine the URL for the Expo preview.
# Check if the correct number of arguments is provided
if [ "$#" -gt 1 ]; then
echo "Usage: $0 [prod]"
exit 1
fi
# Check if the .env file already exists
if [ -f ./apps/docs/.env ]; then
echo "Error: .env file already exists in ./apps/docs"
exit 1
fi
# Determine the Expo preview URL based on the argument provided
if [ "$1" == "prod" ]; then
EXPO_PREVIEW_URL="https://expo-demo.nativeflare.dev"
else
EXPO_PREVIEW_URL="http://localhost:8081"
fi
# Create the .env file with the appropriate Expo preview URL
echo "EXPO_PREVIEW_URL=\"$EXPO_PREVIEW_URL\"" > ./apps/docs/.env
# Display a success message
echo "The .env file with Expo preview URL has been created in ./apps/docs"