Skip to content

Commit 5458994

Browse files
committed
Provide version info to addon at runtime
1 parent 2303d64 commit 5458994

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

.gitignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,5 +140,9 @@ cython_debug/
140140
# Emacs artifacts
141141
*~
142142

143-
# Nix artifacts
144-
*.ankiaddon
143+
# Make artifacts
144+
*.ankiaddon
145+
build_info.py
146+
147+
# Anki runtime artifacts
148+
meta.json

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
pyfiles = __init__.py passfail2.py configuration_menu.py button_color.py config.json
22
version = 0.2.2
33

4+
sed_cmds = -e "s/\$$version/'$(version)'/g"
5+
46
outfile = passfail2-$(version).ankiaddon
57

68
.PHONY: addon clean
@@ -10,6 +12,9 @@ dist: $(outfile)
1012
clean:
1113
rm *.ankiaddon
1214

13-
$(outfile): manifest.json $(pyfiles)
15+
build_info.py: build_info.py.in Makefile
16+
sed $(sed_cmds) $< > $@
17+
18+
$(outfile): manifest.json $(pyfiles) build_info.py
1419
zip -r $(outfile) $^
1520

build_info.py.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
version = $version

0 commit comments

Comments
 (0)