build: add postinstall-patches.js script suitable for postinstall patching of dependencies (#22669)

Because sometimes one has to do what one has to do...

PR Close #22669
This commit is contained in:
Igor Minar 2018-03-08 20:23:33 -08:00 committed by Kara Erickson
parent aa7dba244b
commit 129d1e0fb1
4 changed files with 19 additions and 6 deletions

View File

@ -21,7 +21,7 @@
"prebuildifier": "bazel build --noshow_progress @com_github_bazelbuild_buildtools//buildifier",
"buildifier": "find . -type f \\( -name BUILD -or -name BUILD.bazel \\) ! -path \"*/node_modules/*\" | xargs $(bazel info bazel-bin)/external/com_github_bazelbuild_buildtools/buildifier/buildifier",
"preinstall": "node tools/yarn/check-yarn.js",
"postinstall": "yarn update-webdriver",
"postinstall": "yarn update-webdriver; node ./tools/postinstall-patches.js",
"update-webdriver": "webdriver-manager update --gecko false $CHROMEDRIVER_VERSION_ARG",
"check-env": "gulp check-env"
},
@ -96,7 +96,7 @@
"rollup-plugin-sourcemaps": "0.4.2",
"selenium-webdriver": "3.5.0",
"semver": "5.4.1",
"shelljs": "^0.7.8",
"shelljs": "^0.8.1",
"source-map": "0.5.7",
"source-map-support": "0.4.18",
"systemjs": "0.18.10",

View File

@ -37,7 +37,7 @@ travisFoldEnd "install-yarn"
# Install all npm dependencies according to yarn.lock
travisFoldStart "yarn-install"
(node tools/npm/check-node-modules --purge && yarn update-webdriver) || yarn install --frozen-lockfile --non-interactive
(node tools/npm/check-node-modules --purge && yarn postinstall) || yarn install --frozen-lockfile --non-interactive
travisFoldEnd "yarn-install"

View File

@ -0,0 +1,13 @@
const {set, cd, sed} = require('shelljs');
const path = require('path');
console.log('===== about to run the postinstall.js script =====');
// fail on first error
set('-e');
// print commands as being executed
set('-v');
// jump to project root
cd(path.join(__dirname, '../'));
console.log('===== finished running the postinstall.js script =====');

View File

@ -6420,9 +6420,9 @@ shell-quote@1.6.1:
array-reduce "~0.0.0"
jsonify "~0.0.0"
shelljs@^0.7.8:
version "0.7.8"
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.8.tgz#decbcf874b0d1e5fb72e14b164a9683048e9acb3"
shelljs@^0.8.1:
version "0.8.1"
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.1.tgz#729e038c413a2254c4078b95ed46e0397154a9f1"
dependencies:
glob "^7.0.0"
interpret "^1.0.0"