Skip to content

Commit b35c857

Browse files
scripts
1 parent 8933aaf commit b35c857

File tree

5 files changed

+53
-0
lines changed

5 files changed

+53
-0
lines changed

environment_setup.bat

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ cd frontend
1010
copy .env.template .env
1111
cd ..
1212

13+
REM Set up mobile environment
14+
cd mobile
15+
copy .env.template .env
16+
cd ..
17+
1318
REM Set up worker/tiling_image environment
1419
cd worker\tiling_image
1520
copy .env.template .env

environment_setup.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ cd frontend
1010
cp .env.template .env
1111
cd ..
1212

13+
# Set up mobile environment
14+
cd mobile
15+
cp .env.template .env
16+
cd ..
17+
1318
# Set up worker/tiling_image environment
1419
cd worker/tiling_image
1520
cp .env.template .env

run.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
# Prompt the user for input
4+
read -p "Do you want to run with mobile? (Make sure you are using a Mac and iOS simulators are available) [y/yes or any other key to skip]: " answer
5+
6+
# Convert the answer to lowercase for case-insensitive comparison
7+
answer_lower=$(echo "$answer" | tr '[:upper:]' '[:lower:]')
8+
9+
# Check if the answer is 'y' or 'yes'
10+
if [[ "$answer_lower" == "y" || "$answer_lower" == "yes" ]]; then
11+
echo "Running with mobile..."
12+
./runWithMobileMac.sh
13+
else
14+
echo "Skipping mobile, running without..."
15+
./runWithoutMobile.sh
16+
fi

runWithMobileMac.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
./environment_setup.sh
4+
5+
# Get the current directory (escaped for AppleScript)
6+
CURRENT_DIR=$(printf '%q' "$(pwd)")
7+
8+
# Open new terminal and run Docker (and bring it to front)
9+
osascript <<EOF
10+
tell application "Terminal"
11+
activate
12+
do script "cd $CURRENT_DIR && docker-compose up --build"
13+
end tell
14+
EOF
15+
16+
# Open another new terminal and run mobile setup (and bring it to front)
17+
osascript <<EOF
18+
tell application "Terminal"
19+
activate
20+
do script "cd $CURRENT_DIR/mobile && npm install && cd ios && pod install && cd .. && npm run ios"
21+
end tell
22+
EOF

runWithoutMobile.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
./environment_setup.sh
4+
5+
docker-compose up --build

0 commit comments

Comments
 (0)