diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 23 |
1 files changed, 20 insertions, 3 deletions
@@ -95,11 +95,13 @@ FOMANTIC_DEST_DIR := web_src/fomantic/build WEBPACK_SOURCES := $(shell find web_src/js web_src/less -type f) $(FOMANTIC_DEST) WEBPACK_CONFIGS := webpack.config.js WEBPACK_DEST := public/js/index.js public/css/index.css -WEBPACK_DEST_ENTRIES := public/js public/css public/fonts public/serviceworker.js public/img/svg +WEBPACK_DEST_ENTRIES := public/js public/css public/fonts public/serviceworker.js BINDATA_DEST := modules/public/bindata.go modules/options/bindata.go modules/templates/bindata.go BINDATA_HASH := $(addsuffix .hash,$(BINDATA_DEST)) +SVG_DEST_DIR := public/img/svg + TAGS ?= TAGS_SPLIT := $(subst $(COMMA), ,$(TAGS)) TAGS_EVIDENCE := $(MAKE_EVIDENCE_DIR)/tags @@ -158,6 +160,7 @@ help: @echo " - lint-backend lint backend files" @echo " - watch-frontend watch frontend files and continuously rebuild" @echo " - webpack build webpack files" + @echo " - svg build svg files" @echo " - fomantic build fomantic files" @echo " - generate run \"go generate\"" @echo " - fmt format the Go code" @@ -292,8 +295,8 @@ lint: lint-backend lint-frontend lint-backend: golangci-lint revive vet swagger-check swagger-validate test-vendor .PHONY: lint-frontend -lint-frontend: node_modules - npx eslint web_src/js webpack.config.js +lint-frontend: node_modules svg-check + npx eslint web_src/js build webpack.config.js npx stylelint web_src/less .PHONY: watch-frontend @@ -605,6 +608,20 @@ $(WEBPACK_DEST): $(WEBPACK_SOURCES) $(WEBPACK_CONFIGS) package-lock.json | node_ npx webpack --hide-modules --display-entrypoints=false @touch $(WEBPACK_DEST) +.PHONY: svg +svg: node-check | node_modules + rm -rf $(SVG_DEST_DIR) + node build/generate-svg.js + +.PHONY: svg-check +svg-check: svg + @diff=$$(git diff $(SVG_DEST_DIR)); \ + if [ -n "$$diff" ]; then \ + echo "Please run 'make svg' and commit the result:"; \ + echo "$${diff}"; \ + exit 1; \ + fi; + .PHONY: update-translations update-translations: mkdir -p ./translations |