forked from dublin2019/client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (32 loc) · 1.18 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
VT = \033[$(1)m
VT0 := $(call VT,0)
VT_DIM := $(call VT,2)
VT_HL := $(call VT,33;1)
CHK := $(call VT,32;1)✓${VT0}
ERR := $(call VT,31;1)✖${VT0}
DIST_DIR = dist
REL_BRANCH = gh-pages
release: release-master
release-%:
git checkout $*
@if ! git diff-index --quiet HEAD; then echo "$(ERR) Git working directory is not clean!\n"; exit 1; fi
$(eval HEAD = $(shell git rev-parse --short $*))
@echo "Building $(VT_HL)$*$(VT0) release from commit $(VT_HL)$(HEAD)$(VT0)"
rm -rf $(DIST_DIR)
npm run build:prod
git checkout $(REL_BRANCH)
git merge -s ours --log --no-edit $*
git rm -r --ignore-unmatch $*
mv $(DIST_DIR) $*
git add $*
git commit --amend -C HEAD
git checkout $*
@echo "$(CHK) Done! New merge commit pushed to branch $(VT_HL)$(REL_BRANCH)$(VT0)"
# emails.txt:
# a file with (optional empty lines and) lines like " email@address | loginkey"
# takes the kind of output Arnaud copy-pastes from postgres and spits out wanted csv format
emails.all: emails.txt emails.csv Makefile
(awk '/[a-z]/ {print $$1 "," $$NF}' < $< ; cat emails.csv) | sort | uniq > $@
cp $@ emails.csv
instaloginkeys.js: emails.all make-emailHashToLoginKey.js Makefile
npm run build:instaloginkeys < $<