-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
On Windows (Git Bash), the download_from_zenodo.sh script previously assumed python3 was available. If python3 was not installed or not on PATH, the script stopped after:
✓ Connected to Zenodo record: 18357418
because the first call to python3 inside the loop failed, and set -e caused an early exit. This made the script appear to “hang” or silently stop for users without python3.
I’ve added a small detection block near the top of the script to make it more robust across platforms:
# Determine which Python to use
if command -v python3 >/dev/null 2>&1; then
PYTHON_CMD=python3
elif command -v python >/dev/null 2>&1; then
PYTHON_CMD=python
else
echo "❌ Failed to find a Python interpreter (python3 or python)."
exit 1
fiThen all inline Python calls use "$PYTHON_CMD" instead of hardcoding python3:
download_url=$(echo "$FILES_JSON" | "$PYTHON_CMD" -c "
import sys, json
data = json.load(sys.stdin)
for f in data.get('files', []):
if f.get('key') == '${zenodo_name}':
print(f['links']['self'])
break
" 2>/dev/null)This allows the script to work on systems with only python installed, while still preferring python3 when available, and fails fast with a clear error message if no Python interpreter is found.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels