-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
50 lines (39 loc) · 906 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Support CMD
BUILD_PATH ?= _site
help:
@echo
@echo "Uasge:"
@echo ' make <command>'
@echo
@echo "Command:"
@echo ' serve 启动服务,默认端口 http://127.0.0.1:3000'
@echo ' build 构建静态文件'
@echo ' clean 清理静态文件'
@echo " make new title=\"文章标题\" tag=\"标签\""
@echo ' help 显示帮助信息'
@echo
@echo "Version: 1.0.0"
@echo
serve:
yarn start
build:
yarn build
clean:
yarn clean
push:
git add .
git commit -s -m "add new post"
git push origin main
new:
@$(eval TITLE := $(strip $(title)))
@$(eval TAG := $(strip $(tag)))
@if [ -z "$(TITLE)" ]; then \
echo "Error: Title parameter is missing."; \
exit 1; \
fi
@if [ -z "$(TAG)" ]; then \
echo "Error: Tag parameter is missing."; \
exit 1; \
fi
@python python/new_post.py "$(TITLE)" "$(TAG)"
.PHONY: serve build clean new help