From 1826de71020f79946e648570167639154984e8a8 Mon Sep 17 00:00:00 2001 From: Yax <1949284+kianby@users.noreply.github.com> Date: Sat, 14 Oct 2023 12:37:11 +0200 Subject: [PATCH] use make without arguments for local and remote build --- .gitignore | 3 ++- Makefile | 19 +++++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 1bfc03b..ba40cca 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,5 @@ blog.sublime-project blog.sublime-workspace ssl/ .python-version -poetry.toml \ No newline at end of file +poetry.toml +.local \ No newline at end of file diff --git a/Makefile b/Makefile index 55c2887..8047570 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,23 @@ -site: +# Makefile +# + +# if a file .local exists run site locally +ifeq ($(wildcard .local),) + TARGET = site_remote +else + TARGET = site_local +endif + +site: $(TARGET) + echo $(TARGET) + +site_remote: git pull makesite systemctl reload nginx -site_local: +site_local: ./makesite.py --params params-local.json - -serve: site_local cd _site && python -m SimpleHTTPServer 2> /dev/null || python3 -m http.server dock: site_local