-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathrunner.sh
More file actions
executable file
·76 lines (68 loc) · 2.27 KB
/
Copy pathrunner.sh
File metadata and controls
executable file
·76 lines (68 loc) · 2.27 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/bash
# Runner script for Carpool app
# Provides unified interface for development and production modes
#
# Usage: ./runner.sh [command]
# Commands:
# dev - Run the app in development mode
# ios - Run the app in iOS development mode
# android - Run the app in Android development mode
# prod - Build and run the app in production mode
#
# Environment Variables:
# READ_TIMEOUT - Input timeout in seconds (default: 10s)
# CARPOOL_NONINTERACTIVE - Set to '1' for non-interactive mode
#
# Examples:
# ./runner.sh dev # Interactive development mode
# READ_TIMEOUT=30 ./runner.sh dev # Development with 30s timeout
# CARPOOL_NONINTERACTIVE=1 ./runner.sh prod # Non-interactive production build
set -e # Exit on any error
# Source utility modules
source "./tools/meteor-utils.sh"
source "./tools/ui-utils.sh"
# Function to display usage
show_usage() {
local commands=" ${GREEN}dev${NC} - Run the app in development mode
${GREEN}ios${NC} - Run the app in iOS development mode
${GREEN}android${NC} - Run the app in Android development mode
${GREEN}prod${NC} - Build and run the app in production mode
Examples:
./runner.sh dev
./runner.sh ios
./runner.sh android
./runner.sh prod"
ui_show_usage "runner.sh" "$commands"
}
# Get the command (default to dev if no args provided)
if [ $# -eq 0 ]; then
COMMAND="dev"
else
COMMAND=$1
fi
case $COMMAND in
"dev")
echo -e "${YELLOW}🚀 Starting development server...${NC}"
meteor_run_dev "../config/settings.development.json" "3001"
;;
"ios")
echo -e "${YELLOW}📱 Starting iOS development server...${NC}"
meteor_run_ios "../config/settings.development.json" "3001"
;;
"android")
echo -e "${YELLOW}🤖 Starting Android development server...${NC}"
meteor_run_android "../config/settings.development.json" "3001"
;;
"prod")
echo -e "${YELLOW}🚀 Running production build and run...${NC}"
./build-prod.sh
ui_show_completion "Production build and run"
;;
"help" | "-h" | "--help")
show_usage
;;
*)
ui_error_exit "Unknown command '${COMMAND}'" 1
show_usage
;;
esac