diff --git a/build/build.sh b/build/build.sh index 064f22976..f7c4af86c 100755 --- a/build/build.sh +++ b/build/build.sh @@ -9,7 +9,7 @@ if [ ! -e ./temp/github-milestones.json ]; then fi # write build info to build-info.json -./build/build-info.sh > ./build/build-info.json +npm run build-info GIT_BRANCH=$(([ ! -z "$TRAVIS_BRANCH" ] && echo $TRAVIS_BRANCH) || git rev-parse --abbrev-ref HEAD) GIT_COMMIT_SHORT=$(git rev-parse --verify --short HEAD) diff --git a/docs/Makefile b/docs/Makefile index 8636c74d0..3b93fdebf 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -1,9 +1,8 @@ .SUFFIXES: .md .html .pdf # tested with Pandoc 2.2.1 and Pandoc 1.16 (on travis) -ROOT_DIR=$(CURDIR)/.. BUILD_INFO=$(CURDIR)/build-info.yaml -BUILD_INFO_JSON=$(ROOT_DIR)/build/build-info.json +BUILD_INFO_JSON=$(CURDIR)/../build/build-info.json OPTIONS=--toc --standalone $(BUILD_INFO) all: $(BUILD_INFO) @@ -19,7 +18,7 @@ $(BUILD_INFO): $(BUILD_INFO_JSON) echo '...' >> $@ $(BUILD_INFO_JSON): - cd $(ROOT_DIR) && $(ROOT_DIR)/build/build-info.sh > $@ + npm run build-info %.html: %.md pandoc $(OPTIONS) -o $@ config.yaml $< --template $(CURDIR)/templates/user-manual.html diff --git a/package.json b/package.json index 343789476..b5a15d1f3 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "lint-staged": "lint-staged", "styleguide": "vue-styleguidist server", "styleguide:build": "vue-styleguidist build", + "build-info": "./build/build-info.sh > ./build/build-info.json", "user-manual": "make -BC docs", "release": "./bin/release.sh", "kos-types": "wget http://api.dante.gbv.de/voc/top?uri=http://w3id.org/nkos/nkostype -O config/kos-types.json" @@ -32,7 +33,9 @@ ] }, "gitHooks": { - "pre-commit": "lint-staged" + "pre-commit": "lint-staged", + "post-commit": "build-info", + "post-receive": "build-info" }, "dependencies": { "@fortawesome/fontawesome-svg-core": "^1.2.16",