-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup-dev.sh
More file actions
executable file
·46 lines (38 loc) · 1.51 KB
/
setup-dev.sh
File metadata and controls
executable file
·46 lines (38 loc) · 1.51 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
#!/bin/bash
# Local development setup script that mirrors the GitHub Actions workflow
set -e
echo "🚀 Setting up TidyTuesday development environment..."
# Check if renv is available
if command -v R >/dev/null 2>&1; then
echo "📦 Restoring R packages with renv..."
R -e "if (!requireNamespace('renv', quietly = TRUE)) install.packages('renv'); renv::restore()"
else
echo "⚠️ R not found, skipping R package restoration"
fi
# Check if uv is available
if command -v uv >/dev/null 2>&1; then
echo "🐍 Setting up Python environment with uv..."
uv venv .venv
source .venv/bin/activate
if [ -f requirements.txt ]; then
echo "📦 Installing Python packages..."
uv pip install -r requirements.txt
else
echo "⚠️ requirements.txt not found, skipping Python package installation"
fi
else
echo "⚠️ uv not found, please install uv: https://docs.astral.sh/uv/getting-started/installation/"
fi
# Check if quarto is available
if command -v quarto >/dev/null 2>&1; then
echo "📚 Building Quarto website..."
quarto render
echo "✅ Website built successfully! Open _site/index.html to view locally."
else
echo "⚠️ Quarto not found, please install Quarto: https://quarto.org/docs/get-started/"
fi
echo "🎉 Setup complete!"
echo ""
echo "To activate the Python environment: source .venv/bin/activate" or if using fish shell: . .venv/bin/activate.fish
echo "To preview the website: quarto preview"
echo "To render the website: quarto render"