Skip to content

Commit b06ee93

Browse files
clydinhansl
authored andcommitted
build: add check yarn preinstall script
Direct copy of the script from core.
1 parent b76afb3 commit b06ee93

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"validate": "node ./bin/devkit-admin validate",
3535
"validate-commits": "./bin/devkit-admin validate-commits",
3636
"prepush": "node ./bin/devkit-admin hooks/pre-push",
37+
"preinstall": "node ./tools/yarn/check-yarn.js",
3738
"webdriver-update-appveyor": "webdriver-manager update --standalone false --gecko false --versions.chrome 2.37",
3839
"webdriver-update-circleci": "webdriver-manager update --standalone false --gecko false --versions.chrome $CHROMEDRIVER_VERSION_ARG "
3940
},

tools/yarn/check-yarn.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* @license
3+
* Copyright Google Inc. All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
9+
'use strict';
10+
11+
if (process.env.npm_execpath.indexOf('yarn') === -1) {
12+
throw new Error(
13+
'Please use Yarn instead of NPM to install dependencies. See: https://yarnpkg.com/lang/en/docs/install/');
14+
}

0 commit comments

Comments
 (0)