mirror of
https://github.com/samsonjs/bin.git
synced 2026-03-25 07:55:47 +00:00
Make serve support both python and python3
This commit is contained in:
parent
f9062c25cb
commit
0199b3184f
1 changed files with 5 additions and 1 deletions
6
serve
6
serve
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue