-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathMakefile
89 lines (72 loc) · 2.84 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
GH := https://github.com
MY := javanile/springboard
REPOS := https://api.github.com/repos
PROJECTS_MD := docs/index.md
CONTRIBUTORS_MD := docs/contributors.md
PROJECT_MD := docs/$(project)/index.md
## -------
## Actions
## -------
update: homepage
docs: homepage
top:
@echo "ALL"
## --------
## Projects
## --------
projects: projects = $(shell cat projects.list | grep -E '^[a-zA-Z0-9]' | sed -e 's%^github\.com/%%i')
projects:
@for project in $(projects); do make -s project-page project=$${project}; done
@#for IFS= read project; do [ -n "$${project}" ] && make -s append project="$${project}" ; done < projects.list
project-page:
@make -s $(PROJECT_MD) project=$(project)
$(PROJECT_MD):
@mkdir -p docs/$(project)
@make -s generate-project-page > $@
@echo Created page: $(PROJECT_MD)
generate-project-page: A = B
generate-project-page:
@echo "## $(user)"
@echo "<img src='$(GH)/$(user).png' width='100' height='100' alt='$(user)' />"
@echo "<a href='$(GH)/$(MY)/pulls?q=is%3Apr+author%3A$(user)' target='_blank'>🗣️ Contributes</a>"
@echo "<a href='$(GH)/$(MY)/commits?author=$(user)' target='_blank'>🗣️ Changes</a>"
@echo "<a href='$(GH)/$(MY)/$(user)?tab=repositories&type=source&sort=stargazers' target='_blank'>🗣️ Repositories</a>"
@echo "<a href='$(GH)/pulls?q=is%3Apr+author%3A$(user)' target='_blank'>🗣️ Pull-requests</a>"
@echo ""
## ------------
## Contributors
## ------------
contributors: contributors = $(shell curl -s $(REPOS)/$(MY)/contributors | grep '"login":' | cut -d'"' -f4 | sort -R)
contributors:
@> .rank
@sed -n '1,7p' -i $(CONTRIBUTORS_MD)
@echo "| Front-end 😎 | Nickname | Score |" >> $(CONTRIBUTORS_MD)
@echo "|:------------:|:---------|:-----:|" >> $(CONTRIBUTORS_MD)
@for user in $(contributors); do make -s contributor-score user=$${user} >> .rank; done
@for rank in $$(sort -rnt, .rank); do make -s contributor rank=$${rank} >> $(CONTRIBUTORS_MD); done
@rm .rank
contributor-score: score = $(shell grep -o '$(user)' projects.list | wc -l)
contributor-score:
@echo "$(score),$(user)"
contributor:
@echo -n "| <img src='$(GH)/$${rank##*,}.png' width='64' height='64' alt='$${rank##*,}' />"
@echo -n "| $${rank##*,} "
@echo -n "| $${rank%%,*} "
#@echo "<a href='$(GH)/$(MY)/commits?author=$(user)' target='_blank'>🗣️ Changes</a>"
#@echo "<a href='$(GH)/$(MY)/$(user)?tab=repositories&type=source&sort=stargazers' target='_blank'>🗣️ Repositories</a>"
#@echo "<a href='$(GH)/pulls?q=is%3Apr+author%3A$(user)' target='_blank'>🗣️ Pull-requests</a>"
@echo "|"
## -----
## Tests
## -----
test-project-page:
@make -s project-page project=akoskm/gitforcats
test-project-md-page:
@make -s docs/akoskm/gitforcats/index.md project=akoskm/gitforcats
test-contributor:
@make -s contributor rank=255,samsepiol
test-contributors:
@make -s contributors
@cat $(CONTRIBUTORS_MD)
test-a:
echo $${rank##*,}