improving build, correct phony targets and more correct and verbose download_structure_conversions

This commit is contained in:
Ozbolt Menegatti 2020-07-08 21:52:42 +02:00
parent 5396868601
commit b17510ffe7
2 changed files with 8 additions and 5 deletions

View File

@ -1,5 +1,3 @@
.PHONY: all release build transcrypt copy $(RES_LESS_FILE) $(RES_PY_FILE) $(RES_HTML_FILE) $(RES_XML_FILE)
SRC_FOLDER=$(CURDIR)/../src
RES_FOLDER=$(CURDIR)/../res
@ -20,6 +18,7 @@ RES_PY_FILE=$(SRC_FOLDER)/$(PY_FILE)
RES_HTML_FILE=$(RES_FOLDER)/$(HTML_FILE)
RES_XML_FILE=$(RES_FOLDER)/$(XML_FILE)
.PHONY: all release build transcrypt copy $(RES_LESS_FILE) $(RES_PY_FILE) $(RES_HTML_FILE) $(RES_XML_FILE) $(CONV_FILE)
.DEFAULT_GOAL := all
all: BR_FLAGS := $(BR_FLAGS) --debug

View File

@ -3,15 +3,19 @@
# fail if any command fails
set -e
OUT_FILE=conversions.csv
if [[ -z "${API_KEY}" ]]; then
echo "API_KEY not defined, should be api key to CJVT's gitea"
exit 1
fi
OUT_FILE=conversions.csv
TEMP_FILE=$(mktemp)
if [ -f $OUT_FILE ]; then
echo "file for conversion of SKE collocations: '$OUT_FILE' already exists, skipping."
exit 0
fi
rm -r $OUT_FILE
TEMP_FILE=$(mktemp)
curl -s "https://gitea.cjvt.si/api/v1/repos/generic/data_admin/contents/resources/structure_conversions.csv?token=$API_KEY" -o $TEMP_FILE
echo "wc: $(wc $TEMP_FILE)"