fix(aio): fix patch script on windows

Running the patch script on Windows (with `patch` available) yields an invalid syntax warning, and does not apply patches.

```
kamik@T460p MINGW64 /d/work/angular/aio (master)
$ yarn postinstall
yarn postinstall v0.24.6
$ node tools/cli-patches/patch.js && uglifyjs node_modules/lunr/lunr.js -c -m -o src/assets/js/lunr.min.js --source-map
The syntax of the command is incorrect.
Done in 1.52s.
```
This commit is contained in:
Filipe Silva 2017-06-13 12:43:26 +01:00 committed by Hans
parent 1d93cf2e85
commit 97fd2480e7
1 changed files with 4 additions and 4 deletions

View File

@ -4,9 +4,9 @@ const sh = require('shelljs');
PATCH_LOCK = 'node_modules/@angular/cli/models/webpack-configs/.patched'; PATCH_LOCK = 'node_modules/@angular/cli/models/webpack-configs/.patched';
if (!fs.existsSync(PATCH_LOCK)) { if (!fs.existsSync(PATCH_LOCK)) {
sh.exec('patch -p0 -i tools/cli-patches/ngo-loader.patch');
sh.exec('patch -p0 -i node_modules/purify/angular-cli.patch');
sh.exec('patch -p0 -i tools/cli-patches/scope-hoisting.patch');
sh.exec('patch -p0 -i tools/cli-patches/uglify-config.patch');
sh.touch(PATCH_LOCK); sh.touch(PATCH_LOCK);
sh.exec(`patch -p0 -i tools/cli-patches/ngo-loader.patch &&
patch -p0 -i node_modules/purify/angular-cli.patch &&
patch -p0 -i tools/cli-patches/scope-hoisting.patch &&
patch -p0 -i tools/cli-patches/uglify-config.patch`);
} }