-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_dev.sh
More file actions
64 lines (52 loc) · 1.7 KB
/
setup_dev.sh
File metadata and controls
64 lines (52 loc) · 1.7 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
#!/bin/bash
# TechTACT Website Development Setup Script
# This script helps set up the development environment
set -e # Exit on error
# Colors for output
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
echo -e "${YELLOW}=== TechTACT Website Development Setup ===${NC}\n"
# Check if Python is installed
if ! command -v python3 &> /dev/null; then
echo -e "${YELLOW}Python 3 is required but not installed. Please install Python 3.8+ and try again.${NC}"
exit 1
fi
# Check if pip is installed
if ! command -v pip3 &> /dev/null; then
echo -e "${YELLOW}pip3 is required but not installed. Please install pip and try again.${NC}"
exit 1
fi
# Create and activate virtual environment
echo -e "${GREEN}Creating virtual environment...${NC}"
python -m venv venv
if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "win32" ]]; then
# Windows
source venv/Scripts/activate
else
# Unix-like
source venv/bin/activate
fi
# Upgrade pip
echo -e "\n${GREEN}Upgrading pip...${NC}"
pip install --upgrade pip
# Install dependencies
echo -e "\n${GREEN}Installing dependencies...${NC}"
pip install -r requirements.txt
# Set up environment variables
if [ ! -f ".env" ]; then
echo -e "\n${GREEN}Creating .env file from example...${NC}"
cp .env.example .env
echo -e "${YELLOW}Please edit the .env file with your configuration.${NC}"
else
echo -e "\n${GREEN}.env file already exists.${NC}"
fi
echo -e "\n${GREEN}Setup complete!${NC}"
echo -e "\nTo activate the virtual environment, run:"
if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "win32" ]]; then
echo "source venv/Scripts/activate"
else
echo "source venv/bin/activate"
fi
echo -e "\nThen start the development server with:"
echo "flask run"