diff --git a/index.mk b/index.mk index 7eddeea..227175a 100644 --- a/index.mk +++ b/index.mk @@ -22,8 +22,17 @@ export PATH := ./node_modules/.bin:$(PATH) # Use bash not sh SHELL := /bin/bash +ifeq ("$(wildcard node_modules/@financial-times/n-gage/index.mk)","") +PATH_TO_NGAGE := "" +else +PATH_TO_NGAGE := "node_modules/@financial-times/n-gage/" +endif + # verify that secret-squirrel is set up to run on each commit -SQUIRRELIFY := $(shell node node_modules/@financial-times/n-gage/scripts/squirrelify.js) +SQUIRRELIFY := $(shell node ${PATH_TO_NGAGE}scripts/squirrelify.js) +ifneq ("$(SQUIRRELIFY)","squirrel ok") +$(error ${SQUIRRELIFY}) +endif # Some handy utilities GLOB = git ls-files -z $1 | tr '\0' '\n' | xargs -I {} find {} ! -type l diff --git a/scripts/squirrelify.js b/scripts/squirrelify.js index 6474474..306d3d5 100644 --- a/scripts/squirrelify.js +++ b/scripts/squirrelify.js @@ -19,6 +19,7 @@ try { if (preCommit.indexOf('node_modules/.bin/secret-squirrel') === -1) { squirrelError(); } + console.log('squirrel ok'); } catch (e) { squirrelError(); } diff --git a/secret-squirrel.js b/secret-squirrel.js new file mode 100644 index 0000000..a2850c3 --- /dev/null +++ b/secret-squirrel.js @@ -0,0 +1,10 @@ +module.exports = { + files: { + allow: [], + allowOverrides: [] + }, + strings: { + deny: [], + denyOverrides: [] + } +};