diff options
author | lonkaars <loek@pipeframe.xyz> | 2022-12-28 13:51:16 +0100 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2022-12-28 13:51:16 +0100 |
commit | 8f75fa200e1042f09f0fe3c4805f5600e3567f54 (patch) | |
tree | 8a88264e7bd04ef493d6ce8a481c899b22408d90 /yomichan/makefile | |
parent | ec000fcbb7e721bfd2638427d54f56f2dae76316 (diff) |
makefile shuffle + WIP yomichan sentence export patch
Diffstat (limited to 'yomichan/makefile')
-rw-r--r-- | yomichan/makefile | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/yomichan/makefile b/yomichan/makefile new file mode 100644 index 0000000..a4f19df --- /dev/null +++ b/yomichan/makefile @@ -0,0 +1,30 @@ +all: + +.PHONY: clean patch update + +include ../common.mk + +yomichan/js/user.js: sentence-export.min.js yomichan + ln -sf ../../$< $@ + +yomichan-chrome.zip: + curl https://github.com/FooSoft/yomichan/releases/latest/download/$@ -Lso- > $@ + +yomichan: yomichan-chrome.zip + unzip -qo yomichan-chrome.zip -d yomichan + +yomichan/manifest.json.bak: yomichan/manifest.json + mv $< $@ + jq '.content_scripts[0].js[.content_scripts[0].js | length] |= .+ "js/user.js"' $@ > $< + +yomichan/search.html.bak: yomichan/search.html + mv $< $@ + sed 's#</body>#<script defer src="/js/user.js"></script>\n</body>#' $@ > $< + +patch: yomichan yomichan/search.html.bak yomichan/manifest.json.bak + +update: yomichan + +clean: + $(RM) sentence-export.min.js sentence-export.src + |