diff options
-rw-r--r-- | .drone.yml | 9 | ||||
-rw-r--r-- | Makefile | 4 | ||||
-rwxr-xr-x | check-handlebars-templates.sh | 17 | ||||
-rwxr-xr-x | compile-handlebars-templates.sh | 6 | ||||
-rw-r--r-- | package.json | 1 |
5 files changed, 35 insertions, 2 deletions
diff --git a/.drone.yml b/.drone.yml index f82de7b6b..296577a6f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -31,6 +31,14 @@ pipeline: when: matrix: TESTS: check-app-compatbility + handlebars: + image: node + commands: + - npm install -g handlebars + - ./check-handlebars-templates.sh + when: + matrix: + TESTS: handlebars syntax-php7.0: image: nextcloudci/php7.0:php7.0-19 environment: @@ -193,6 +201,7 @@ matrix: - TESTS: eslint - TESTS: stylelint - TESTS: check-app-compatbility + - TESTS: handlebars - TESTS: syntax-php7.0 - TESTS: signed-off-check - TESTS: php7.0 @@ -31,8 +31,8 @@ install-npm-deps: install-npm-deps-dev: npm install --deps -build-js-templates: - handlebars -n OCA.VideoCalls.Admin.Templates js/admin/templates/ -f js/admin/templates.js +compile-handlebars-templates: dev-setup + bash compile-handlebars-templates.sh dev-setup: install-npm-deps-dev diff --git a/check-handlebars-templates.sh b/check-handlebars-templates.sh new file mode 100755 index 000000000..ae1e63946 --- /dev/null +++ b/check-handlebars-templates.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +REPODIR=`git rev-parse --show-toplevel` + +cd $REPODIR + +bash compile-handlebars-templates.sh || exit 1 + +if [[ $(git diff --name-only) ]]; then + echo "Please submit your compiled handlebars templates" + echo + git diff + exit 1 +fi + +echo "All up to date! Carry on :D" +exit 0 diff --git a/compile-handlebars-templates.sh b/compile-handlebars-templates.sh new file mode 100755 index 000000000..663a5bd83 --- /dev/null +++ b/compile-handlebars-templates.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +# Prefer the local handlebars script, and fall back to the global one. +export PATH=./node_modules/.bin/:$PATH + +handlebars -n OCA.VideoCalls.Admin.Templates js/admin/templates/ -f js/admin/templates.js diff --git a/package.json b/package.json index e79680966..35e629af0 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "author": "", "license": "AGPL-3.0", "devDependencies": { + "handlebars": "^4.0.12", "jasmine": "^2.5.2", "jasmine-ajax": "^3.2.0", "jasmine-core": "^2.5.2", |