-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathupdate.sh
More file actions
executable file
·49 lines (42 loc) · 1.29 KB
/
update.sh
File metadata and controls
executable file
·49 lines (42 loc) · 1.29 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
#!/bin/sh
# Make sure to execute from the scripts directory
cd "$(dirname "$0")"
# Check if uv is available
if command -v uv &> /dev/null; then
echo "Using uv to run the Python updater..."
if [[ -f "update.py" ]]; then
uv run update.py "$@"
exit $?
else
echo "Error: update.py not found in current directory"
exit 1
fi
fi
# Fallback to regular Python if uv is not available
echo "uv not found, falling back to Python..."
# Check if Python 3 is available
if command -v python3 &> /dev/null; then
PYTHON_CMD="python3"
elif command -v python &> /dev/null && python --version 2>&1 | grep -q "Python 3"; then
PYTHON_CMD="python"
else
echo "Error: Python 3 is required but not found"
echo "Please install Python 3 or uv (recommended)"
echo ""
echo "To install uv:"
echo " curl -LsSf https://astral.sh/uv/install.sh | sh"
echo ""
echo "To install Python 3:"
echo " macOS: brew install python3"
echo " Linux: sudo apt install python3 (or equivalent)"
exit 1
fi
# Check if the Python script exists
if [[ ! -f "update.py" ]]; then
echo "Error: update.py not found in current directory"
exit 1
fi
# Run the Python updater
echo "Starting locale update using Python..."
$PYTHON_CMD update.py "$@"
echo "Update completed"