Skip to content

Commit 7b78236

Browse files
committed
Integrate copying/moving logic to makefile and fix server command
Signed-off-by: Mateus Felipe C. C. Pinto <[email protected]>
1 parent cf4680a commit 7b78236

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
*~
22
*#*#
33
*.pdf
4-
*.html
4+
5+
static

Makefile

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ATTENTION_PREFIX := "\033[1;36m[!]\033[0m "
1414

1515
.PHONY: clean shell
1616

17-
all: $(HTML_FILES)
17+
all: $(HTML_FILES) copy
1818

1919
shell:
2020
$(DOCKER_RUN) -i --entrypoint=/bin/zsh $(DOCKER_IMG)
@@ -24,8 +24,21 @@ shell:
2424
@$(DOCKER_RUN) $(DOCKER_IMG) $< $(EMACS_FLAGS) -f org-html-export-to-html
2525
@$(DOCKER_RUN) --entrypoint=/bin/chown $(DOCKER_IMG) $(USER) "$*.html"
2626

27+
copy:
28+
@mkdir -p static
29+
@find . \
30+
"(" -name "*.html" -o -name "*.css" -o -name "*.js" ")" \
31+
-not -path "./static/*" \
32+
-not -path "./.github/*" \
33+
-exec cp {} static \;
34+
@find . \
35+
-name "*.html" \
36+
-not -path "./static/*" \
37+
-not -path "./.github/*" \
38+
-exec mv {} static \;
39+
2740
server:
28-
python3 -m http.server 8000
41+
python3 -m http.server 8000 --directory ./static
2942

3043
clean:
31-
rm -rf *.html
44+
rm -rf ./static

0 commit comments

Comments
 (0)