Skip to content

Commit

Permalink
Merge pull request #15 from nongrata081/feature/issues-7-enforce-yarn
Browse files Browse the repository at this point in the history
feat(enforce-yarn): enforce yarn instead of npm on install of packages
  • Loading branch information
nongrata081 committed Mar 31, 2019
2 parents 872b073 + 5802eca commit 54104c4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
8 changes: 8 additions & 0 deletions scripts/enforce-yarn.js
Original file line number Diff line number Diff line change
@@ -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);
}

0 comments on commit 54104c4

Please sign in to comment.