-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
49 lines (43 loc) · 1.07 KB
/
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
SHELL = /bin/bash
.SILENT: # comment this one out if you need to debug the Makefile
APP=logseq-export
.PHONY: build
build:
go build ./...
# go build -o ${APP} main.go
.PHONY: test
test:
go test ./...
.PHONY: watch-test
watch-test:
fswatch \
--exclude '.git' \
--exclude 'logseq-export$$' \
--exclude 'test/test-output' \
--exclude 'example/' \
-o . | \
xargs -n1 -I{} go test ./...
.PHONY: clean
clean:
go clean
.PHONY: example
example:
$(MAKE) build
tmp_export_folder=$$(mktemp -d); \
./logseq-export \
--logseqFolder "$(CURDIR)/example/logseq-graph" \
--outputFolder "$$tmp_export_folder"; \
./import_to_hugo.sh "$$tmp_export_folder" "$(CURDIR)/example/logseq-export-example"
.PHONY: watch-example
watch-example:
fswatch \
--exclude '.git' \
--exclude 'logseq-export$$' \
--exclude 'test/test-output' \
--exclude 'example/logseq-export-example/content/graph' \
--exclude 'example/logseq-export-example/static/assets/graph' \
-xn . | \
while read file event; do \
echo "File $$file has changed, Event: $$event"; \
$(MAKE) example; \
done