From 36f152cc971b721cb3bb9455e2341edc2d8fcb2f Mon Sep 17 00:00:00 2001 From: Joren Broekema Date: Fri, 28 Jun 2019 11:00:23 +0200 Subject: [PATCH] chore: add extra husky check --- package.json | 3 +++ scripts/yarn-lock-scan.js | 10 ++++++++++ 2 files changed, 13 insertions(+) create mode 100644 scripts/yarn-lock-scan.js diff --git a/package.json b/package.json index d1617d8f4..213ff0848 100644 --- a/package.json +++ b/package.json @@ -59,6 +59,9 @@ "eslint --fix", "prettier --write", "git add" + ], + "yarn.lock": [ + "node ./scripts/yarn-lock-scan.js" ] } } diff --git a/scripts/yarn-lock-scan.js b/scripts/yarn-lock-scan.js new file mode 100644 index 000000000..0e44414ec --- /dev/null +++ b/scripts/yarn-lock-scan.js @@ -0,0 +1,10 @@ +const fs = require('fs'); +const path = require('path'); + +const yarnLockPath = './yarn.lock'; +const data = fs.readFileSync(path.resolve(yarnLockPath), 'utf8'); +if (data.match(/artifactory/g)) { + throw new Error( + 'Artifactory references in your yarn.lock! Please make sure you are using the official yarn or npm registry when downloading your dependencies!', + ); +}