Fix downloading metrics with spaces

This commit is contained in:
Filip Gralinski 2021-09-17 12:16:34 +02:00
parent ef4bde5327
commit ff736acc77
2 changed files with 4 additions and 2 deletions

View File

@ -13,6 +13,8 @@ CURRENT_DIR=$(shell pwd)
AUTOZOIL_DIR?=/opt/autozoil AUTOZOIL_DIR?=/opt/autozoil
AUTOZOIL_LOCALE={{cookiecutter.locale}} AUTOZOIL_LOCALE={{cookiecutter.locale}}
space := $(subst ,, )
ifneq (,$(wildcard appendix.tex)) ifneq (,$(wildcard appendix.tex))
ifeq ($(LATEX_TEMPLATE),acl) ifeq ($(LATEX_TEMPLATE),acl)
IS_APPENDIX_SEPARATE=yes IS_APPENDIX_SEPARATE=yes
@ -62,7 +64,7 @@ sentences.txt: $(PAPER_ID).pdf helpers/get-sentences.sh helpers/pdf-to-plain-tex
scores/%.txt: scores/%.txt:
mkdir -p scores mkdir -p scores
curl "https://gonito.net/api/txt/score/"$* -o $@ curl "https://gonito.net/api/txt/score/$(subst $(space),%20,$*)" -o "$@"
autozoil-log.txt: $(CONTENT_TEX_SOURCES) autozoil-log.txt: $(CONTENT_TEX_SOURCES)
cd $(AUTOZOIL_DIR) && set -o pipefail && ./autozoil --locale $(AUTOZOIL_LOCALE) $(CONTENT_TEX_SOURCES_WITH_DIR) --alt-log-file $(CURRENT_DIR)/$(PAPER_ID).log | tee $(CURRENT_DIR)/$@ cd $(AUTOZOIL_DIR) && set -o pipefail && ./autozoil --locale $(AUTOZOIL_LOCALE) $(CONTENT_TEX_SOURCES_WITH_DIR) --alt-log-file $(CURRENT_DIR)/$(PAPER_ID).log | tee $(CURRENT_DIR)/$@

View File

@ -17,4 +17,4 @@ for my $filepath (@ARGV) {
close($ih); close($ih);
} }
print join(" ", map { "scores/${_}.txt" } sort keys %found); print join(" ", map { "scores/${_}.txt" } map { s/ /\\ /g; $_} sort keys %found);