Skip to content

Commit

Permalink
newest make
Browse files Browse the repository at this point in the history
  • Loading branch information
jm1021 committed Sep 19, 2023
1 parent d075dcb commit bf31379
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Configuration, override port with usage: make PORT=4200
PORT ?= 4200
REPO_NAME ?= Nighthawk-Pages
PORT ?= 4100
REPO_NAME ?= teacher
LOG_FILE = /tmp/jekyll$(PORT).log

SHELL = /bin/bash
# .SHELLFLAGS = -e # Exceptions will stop make, works on MacOS
.SHELLFLAGS = -e # Exceptions will stop make, works on MacOS

# Phony Targets, makefile housekeeping for below definitions
.PHONY: default server convert clean stop
Expand All @@ -25,7 +25,7 @@ default: server
@# tail and awk work together to extract Jekyll regeneration messages
@# When a _notebook is detected in the log, call make convert in the background
@# Note: We use the "if ($$0 ~ /_notebooks\/.*\.ipynb/) { system(\"make convert &\") }" to call make convert
@(tail -f $(LOG_FILE) | awk '/Server address: http:\/\/0.0.0.0:$(PORT)\/$(REPO_NAME)\// { serverReady=1 } \
@(tail -f $(LOG_FILE) | awk '/Server address: http:\/\/127.0.0.1:$(PORT)\/$(REPO_NAME)\// { serverReady=1 } \
serverReady && /^ *Regenerating:/ { regenerate=1 } \
regenerate { \
if (/^[[:blank:]]*$$/) { regenerate=0 } \
Expand Down Expand Up @@ -56,7 +56,7 @@ default: server
# Start the local web server
server: stop convert
@echo "Starting server..."
@@nohup bundle exec jekyll serve -H 0.0.0.0 -P $(PORT) > $(LOG_FILE) 2>&1 & \
@@nohup bundle exec jekyll serve -H 127.0.0.1 -P $(PORT) > $(LOG_FILE) 2>&1 & \
PID=$$!; \
echo "Server PID: $$PID"
@@until [ -f $(LOG_FILE) ]; do sleep 1; done
Expand Down

0 comments on commit bf31379

Please sign in to comment.