diff --git a/package.json b/package.json index 1ec4016..efdabdf 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "0.0.0", "description": "seed repository with basic functionality", "scripts": { + "preinstall": "node scripts/enforce-yarn.js", "commit": "git-cz", "enforce:gitflow": "node ./node_modules/.bin/enforce-gitflow-branches" }, diff --git a/scripts/enforce-yarn.js b/scripts/enforce-yarn.js new file mode 100644 index 0000000..1c279da --- /dev/null +++ b/scripts/enforce-yarn.js @@ -0,0 +1,8 @@ +/** + * Restrict using `npm` for installing packages + */ +if (process.env.npm_execpath.indexOf('yarn') === -1) { + console.error('You must use Yarn to install dependencies:'); + console.error(' $ yarn install'); + process.exit(1); +}