-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
58 lines (43 loc) · 1.26 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
50
51
52
53
54
55
56
57
58
DATE=$(shell date +"%Y%m%d")
TS=$(shell date +%s)
STATUS=$(shell echo "Whoop, I did this!")
PORT?=4000
ifeq ($(WD),)
WD:=$(shell pwd)
endif
deps:
cd site && (yarn || npm i)
start:
make deps
make statics
make run
run:
nim c --threads:on -r src/tinylog.nim -p:${PORT} -d:$(WD)
compile:
nim c --threads:on src/tinylog.nim
make release:
make compile
mkdir -p release/site/data \
release/site/dumps \
release/site/static
mv src/tinylog release/
cp Makefile release/
cp -r site/scripts release/site/
cp -r site/stylus release/site/
cp -r site/package.json release/site/
tar -czf tinylog-$(NAME).tar.gz release/
statics:
make deps
cd site && (yarn css || npm run css)
cd site && (yarn js || npm run js)
watch-css:
cd site && (yarn css -w || npm run css -w)
watch-js:
cd site && (yarn js -w || npm run js -w)
dump:
firefox -p tinylog -screenshot site/dumps/$(DATE).png http://localhost:${PORT}/log/$(DATE) --window-size=332,346
auth:
twurl authorize --consumer-key ${CON_KEY} --consumer-secret ${CON_SECRET}
tweet:
$(eval M_ID=$(shell twurl -H upload.twitter.com "/1.1/media/upload.json" -f "site/dumps/$(DATE).png" -F media -X POST | grep -Po '"media_id":\d+' | grep -Po '\d+'))
twurl "/1.1/statuses/update.json" -d "media_ids=${M_ID}&status=$(STATUS)"