-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathMakefile
54 lines (42 loc) · 1.19 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
GDOCIDFILE=local/gdocid
GDOCID=`cat $(GDOCIDFILE)`
TODAY=`date "+%Y-%m-%d"`
MONTH=`date "+%Y-%m"`
DIARY_MD_PATH=`date "+raw-data/.notable/notes/diary/%Y/%m/%Y-%m-%d.md"`
PFCSV="local/portfolio-$(TODAY).csv"
NWCSV="local/net-worth-$(TODAY).csv"
all: prices
prices-today:
./scripts/update-prices.py --today-only | sh
prices:
./scripts/update-prices.py | sh
fava:
fava ledger/main.beancount
%:
bean-$@ ledger/main.beancount
portfolio:
@./scripts/generate-portfolio.py
networth:
@./scripts/generate-networth-report.py
gdocid:
@test -f $(GDOCIDFILE) && true || (echo "Please fill gdoc id in $(GDOCIDFILE)"; exit 1)
spreadsheet: gdocid
@echo "Generating $(PFCSV) ..."
@./scripts/generate-portfolio.py > $(PFCSV)
@echo "$(PFCSV) Done\n"
@echo "Generating $(NWCSV) ..."
@./scripts/generate-networth-report.py --padding --since 2019-10-01 > $(NWCSV)
@echo "$(NWCSV) Done\n"
@egrep "^(日期|$(MONTH))" $(NWCSV) | column -ts,
@echo "Uploading to spreadsheet ..."
@upload-to-sheets --docid=$(GDOCID) $(PFCSV):持仓 $(NWCSV):净值
today:
make prices-today
make spreadsheet
backup:
git stash
git pull --rebase origin master
git stash pop
git add .
git commit -m "AutoBackup"
git push origin master