Skip to content

Commit 129d1e0

Browse files
IgorMinarkara
authored andcommitted
build: add postinstall-patches.js script suitable for postinstall patching of dependencies (angular#22669)
Because sometimes one has to do what one has to do... PR Close angular#22669
1 parent aa7dba2 commit 129d1e0

File tree

4 files changed

+19
-6
lines changed

4 files changed

+19
-6
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"prebuildifier": "bazel build --noshow_progress @com_github_bazelbuild_buildtools//buildifier",
2222
"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",
2323
"preinstall": "node tools/yarn/check-yarn.js",
24-
"postinstall": "yarn update-webdriver",
24+
"postinstall": "yarn update-webdriver; node ./tools/postinstall-patches.js",
2525
"update-webdriver": "webdriver-manager update --gecko false $CHROMEDRIVER_VERSION_ARG",
2626
"check-env": "gulp check-env"
2727
},
@@ -96,7 +96,7 @@
9696
"rollup-plugin-sourcemaps": "0.4.2",
9797
"selenium-webdriver": "3.5.0",
9898
"semver": "5.4.1",
99-
"shelljs": "^0.7.8",
99+
"shelljs": "^0.8.1",
100100
"source-map": "0.5.7",
101101
"source-map-support": "0.4.18",
102102
"systemjs": "0.18.10",

scripts/ci/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ travisFoldEnd "install-yarn"
3737

3838
# Install all npm dependencies according to yarn.lock
3939
travisFoldStart "yarn-install"
40-
(node tools/npm/check-node-modules --purge && yarn update-webdriver) || yarn install --frozen-lockfile --non-interactive
40+
(node tools/npm/check-node-modules --purge && yarn postinstall) || yarn install --frozen-lockfile --non-interactive
4141
travisFoldEnd "yarn-install"
4242

4343

tools/postinstall-patches.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const {set, cd, sed} = require('shelljs');
2+
const path = require('path');
3+
4+
console.log('===== about to run the postinstall.js script =====');
5+
// fail on first error
6+
set('-e');
7+
// print commands as being executed
8+
set('-v');
9+
// jump to project root
10+
cd(path.join(__dirname, '../'));
11+
12+
13+
console.log('===== finished running the postinstall.js script =====');

yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6420,9 +6420,9 @@ shell-quote@1.6.1:
64206420
array-reduce "~0.0.0"
64216421
jsonify "~0.0.0"
64226422

6423-
shelljs@^0.7.8:
6424-
version "0.7.8"
6425-
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.8.tgz#decbcf874b0d1e5fb72e14b164a9683048e9acb3"
6423+
shelljs@^0.8.1:
6424+
version "0.8.1"
6425+
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.1.tgz#729e038c413a2254c4078b95ed46e0397154a9f1"
64266426
dependencies:
64276427
glob "^7.0.0"
64286428
interpret "^1.0.0"

0 commit comments

Comments
 (0)