Make serve support both python and python3

This commit is contained in:
Sami Samhuri 2025-11-24 14:16:43 -08:00
parent f9062c25cb
commit 0199b3184f
No known key found for this signature in database

6
serve
View file

@ -1,4 +1,8 @@
#!/bin/bash #!/bin/bash
PORT="${1:-8080}" PORT="${1:-8080}"
python -m SimpleHTTPServer $PORT if which python >= /dev/null 2>&1; then
python -m SimpleHTTPServer $PORT
else
python3 -m http.server $PORT
fi