From 97fd2480e78513147f1a60fb7bbf0c4ec4dc8524 Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Tue, 13 Jun 2017 12:43:26 +0100 Subject: [PATCH] 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. ``` --- aio/tools/cli-patches/patch.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/aio/tools/cli-patches/patch.js b/aio/tools/cli-patches/patch.js index 28a61bdba4..70e7a20b8b 100644 --- a/aio/tools/cli-patches/patch.js +++ b/aio/tools/cli-patches/patch.js @@ -4,9 +4,9 @@ const sh = require('shelljs'); PATCH_LOCK = 'node_modules/@angular/cli/models/webpack-configs/.patched'; 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.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`); }