structure conversions implemented, had to update makefile, gitignore etc.
This commit is contained in:
@@ -13,6 +13,7 @@ LESS_FILE=main.less
|
||||
PY_FILE=main.py
|
||||
HTML_FILE=main.html
|
||||
XML_FILE=vsms1.xml
|
||||
CONV_FILE=conversions.csv
|
||||
|
||||
RES_LESS_FILE=$(RES_FOLDER)/$(LESS_FILE)
|
||||
RES_PY_FILE=$(SRC_FOLDER)/$(PY_FILE)
|
||||
@@ -32,7 +33,7 @@ build: copy $(CSS_FILE) bundle.js local.js
|
||||
transcrypt: $(RES_PY_FILE) $(TS_BUILD)
|
||||
transcrypt $(TS_FLAGS) $<
|
||||
|
||||
bundle.js: transcrypt
|
||||
bundle.js: transcrypt $(CONV_FILE)
|
||||
cd ..; browserify $(BR_FLAGS) build/$(TS_BUILD)/main.js -o build/bundle.js
|
||||
|
||||
local.js:
|
||||
@@ -50,9 +51,12 @@ $(HTML_FILE): $(RES_HTML_FILE)
|
||||
$(XML_FILE): $(RES_XML_FILE)
|
||||
cp $(RES_XML_FILE) $@
|
||||
|
||||
$(CONV_FILE): $(TS_BUILD)
|
||||
./download_structure_conversions.sh
|
||||
|
||||
copy: $(XML_FILE) $(HTML_FILE)
|
||||
|
||||
clean:
|
||||
rm -fr $(TS_BUILD)
|
||||
rm -f $(HTML_FILE) $(XML_FILE) bundle.js index.html main.css local.js
|
||||
rm -f $(HTML_FILE) $(XML_FILE) bundle.js index.html main.css local.js $(CONV_FILE)
|
||||
|
||||
|
||||
19
build/download_structure_conversions.sh
Executable file
19
build/download_structure_conversions.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
# fail if any command fails
|
||||
set -e
|
||||
|
||||
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
|
||||
|
||||
rm -f $OUT_FILE
|
||||
|
||||
for fname in glagol pridevnik prislov samostalnik; do
|
||||
curl -s "https://gitea.cjvt.si/api/v1/repos/redmine_projects/kolokacije/contents/resources/structure_conversions/$fname.csv?token=$API_KEY" |
|
||||
python3 -c "import sys, json; print(json.load(sys.stdin)['content'])" | base64 -d >> $OUT_FILE
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user