-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
32 lines (25 loc) · 902 Bytes
/
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
.PHONY: check init-remotes install-modules update-modules
# default target
check:
git --version
jq --version
sopel --version
python -c "import dateparser"
@echo All ok?!
define get_release
curl --silent "https://api.github.com/repos/sopel-irc/$(1)/releases/latest" | jq -r .tag_name
endef
plugins = sopel-chanlogs sopel-github
init-remotes:
@$(foreach plugin,$(plugins), \
git ls-remote plugin-$(plugin) > /dev/null || \
git remote add -f plugin-$(plugin) https://github.com/sopel-irc/$(plugin).git ;\
)
install-modules: init-remotes
@$(foreach plugin,$(plugins), \
[ -e external/$(plugin) ] || git subtree add --prefix external/$(plugin) plugin-$(plugin) `$(call get_release,$(plugin))` --squash ;\
)
update-modules: install-modules
@$(foreach plugin,$(plugins), \
git subtree pull --prefix external/$(plugin) plugin-$(plugin) `$(call get_release,$(plugin))` --squash ;\
)