-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·109 lines (88 loc) · 2.63 KB
/
setup.sh
File metadata and controls
executable file
·109 lines (88 loc) · 2.63 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#!/bin/bash
set -e
echo "Setting up everything-cli..."
# Check if Python is installed
if ! command -v python3 &> /dev/null; then
echo "ERROR: Python 3 is required but not installed."
exit 1
fi
# Install dependencies
echo "Installing dependencies..."
pip3 install -r requirements.txt
# Verify detect-secrets is installed
echo "Verifying detect-secrets installation..."
if ! command -v detect-secrets &> /dev/null; then
echo "ERROR: detect-secrets installation failed."
exit 1
fi
echo "detect-secrets $(detect-secrets --version) installed successfully"
# Install pre-commit hooks
echo "Installing pre-commit hooks for secret scanning..."
if ! command -v pre-commit &> /dev/null; then
echo "ERROR: pre-commit is not installed. Installing from requirements.txt should have fixed this."
exit 1
fi
pre-commit install
# Verify installation
echo ""
echo "Setup complete!"
echo ""
echo "Verifying pre-commit hooks are active..."
if [ -f .git/hooks/pre-commit ]; then
echo "SUCCESS: Pre-commit hooks installed successfully"
echo ""
echo "Secret scanning protection is now active!"
else
echo "ERROR: Pre-commit hooks not found. Something went wrong."
exit 1
fi
echo ""
echo "Setting up Python projects..."
# Python folders setup
PYTHON_FOLDERS=("autogitignore" "gemini" "tcp-messenger")
for folder in "${PYTHON_FOLDERS[@]}"; do
if [ -d "$folder" ]; then
echo "Setting up $folder..."
cd "$folder"
if [ ! -d "venv" ]; then
echo " Creating virtual environment..."
python3 -m venv venv
echo " Installing requirements..."
source venv/bin/activate
if [ -f "requirements.txt" ]; then
pip install -r requirements.txt
fi
deactivate
else
echo " Virtual environment already exists"
fi
cd ..
fi
done
echo ""
echo "Setting up npm projects..."
# npm folders setup
NPM_FOLDERS=("spotify" "tele" "whatsapp")
for folder in "${NPM_FOLDERS[@]}"; do
if [ -d "$folder" ]; then
echo "Setting up $folder..."
cd "$folder"
if [ ! -d "node_modules" ]; then
echo " Running npm install..."
npm install
else
echo " node_modules already exists"
fi
if [ -f ".env.sample" ] && [ ! -f ".env" ]; then
echo " Copying .env.sample to .env..."
cp .env.sample .env
fi
cd ..
fi
done
echo ""
echo "Setup complete!"
echo ""
echo "Next steps:"
echo " 1. Update .env files in subdirectories with your credentials"
echo " 2. The .env files are automatically ignored by git"