1
0
mirror of https://github.com/angular/angular-cli.git synced 2025-05-22 23:15:56 +08:00

build: add check yarn preinstall script

Direct copy of the script from core.
This commit is contained in:
Charles Lyding 2018-10-01 13:45:20 -04:00 committed by Hans
parent b76afb35e0
commit b06ee93e07
2 changed files with 15 additions and 0 deletions

@ -34,6 +34,7 @@
"validate": "node ./bin/devkit-admin validate",
"validate-commits": "./bin/devkit-admin validate-commits",
"prepush": "node ./bin/devkit-admin hooks/pre-push",
"preinstall": "node ./tools/yarn/check-yarn.js",
"webdriver-update-appveyor": "webdriver-manager update --standalone false --gecko false --versions.chrome 2.37",
"webdriver-update-circleci": "webdriver-manager update --standalone false --gecko false --versions.chrome $CHROMEDRIVER_VERSION_ARG "
},

14
tools/yarn/check-yarn.js Normal file

@ -0,0 +1,14 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
'use strict';
if (process.env.npm_execpath.indexOf('yarn') === -1) {
throw new Error(
'Please use Yarn instead of NPM to install dependencies. See: https://yarnpkg.com/lang/en/docs/install/');
}