-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathlocal-env.sh
More file actions
executable file
·52 lines (40 loc) · 1.18 KB
/
local-env.sh
File metadata and controls
executable file
·52 lines (40 loc) · 1.18 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
#!/bin/bash
# Remove existing virtual environment
rm -rf .venv
# Create a new virtual environment
python3 -m venv .venv
# Activate the virtual environment
source .venv/bin/activate
# Ensure the correct Python version is being used
pyenv global 3.9.11
eval "$(pyenv init --path)"
# Install the required packages
echo "Install requirements"
pip install -r requirements.txt
# Print completion messages
echo "---------------------------"
echo ".venv recreated and sourced"
echo "Set python version to 3.9.11"
echo "Installed requirements"
echo "Complete"
echo "---------------------------"
# download these files
urls=(
"https://brave-today-cdn.brave.com/brave-today/feed.en_US.json"
"https://brave-today-cdn.brave.com/source-suggestions/articles_history.en_US.csv"
"https://brave-today-cdn.brave.com/sources.en_US.json"
)
for url in "${urls[@]}"; do
# Extract filename from URL
filename=$(basename "$url")
# Download the file using wget
wget -O "$filename" "$url"
# Check if download was successful
if [ $? -eq 0 ]; then
echo "Successfully downloaded: $filename"
else
echo "Failed to download: $filename"
fi
done
# Keep the virtual environment active
exec "$SHELL"