summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorCaitlin Campbell <caitlin@cissols.com>2019-11-25 13:33:35 +0100
committerCaitlin Campbell <caitlin@cissols.com>2019-11-25 20:27:06 +0100
commitfd3be389b94a4054d42fd63c15ab320139ac94f1 (patch)
treed291cbf98cae0aeb4dc0b68722b9b474b644a941 /Makefile
parentb3fb11e4282a118591e8768935c7792f56ee0ebe (diff)
Add cleaner python2/3 make serve command
Stop the need to Ctrl-C twice in the event where you have both python versions on your system.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 7 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index b0ffe45..e7156fa 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,14 @@
+PYTHON3_AVAILABLE := $(shell python3 --version 2>&1)
+
site:
./makesite.py
serve: site
- cd _site && python -m SimpleHTTPServer 2> /dev/null || python3 -m http.server
+ifeq ('$(PYTHON3_AVAILABLE)','')
+ cd _site && python -m SimpleHTTPServer
+else
+ cd _site && python3 -m http.server
+endif
venv2:
virtualenv ~/.venv/makesite