Skip to content

Commit

Permalink
simpleserver python 2 and 3 (RetireJS#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
lillypad authored and eoftedal committed Jan 22, 2020
1 parent f07a755 commit 9ca9e4d
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions simpleserver.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
#!/bin/bash
#!/bin/env bash

PYTHON_VERSION=$(python -c 'import sys; print("%i" % (sys.hexversion<0x03000000))')

if [ -z "$1" ]; then
PORT=8000
else
PORT=$1
fi

cd repository
python -m SimpleHTTPServer

if [ ${PYTHON_VERSION} -eq 0 ]; then
python -m http.server $PORT
else
python -m SimpleHTTPServer $PORT
fi

0 comments on commit 9ca9e4d

Please sign in to comment.