diff --git a/tools/postinstall-patches.js b/tools/postinstall-patches.js index 4e22d1ea47dfdf..138353331c024b 100644 --- a/tools/postinstall-patches.js +++ b/tools/postinstall-patches.js @@ -21,7 +21,7 @@ try { } const {set, cd, sed, echo, ls, rm} = require('shelljs'); -const {readFileSync} = require('fs'); +const {readFileSync, writeFileSync} = require('fs'); const path = require('path'); const log = console.info; @@ -172,4 +172,21 @@ rm('-rf', [ ]); +log('\n# patch: dev-infra snapshotting'); +// more info in https://github.com/angular/dev-infra/pull/449 +[ + 'node_modules/@angular/dev-infra-private/ng-dev/bundles/cli.js', + 'node_modules/@angular/dev-infra-private/ng-dev/bundles/cli.js.map', +].forEach(filePath => { + const contents = readFileSync(filePath, 'utf8'); + const newContents = contents.replace('*[0-9]*.[0-9]*.[0-9]*', 'v[0-9]*.[0-9]*.[0-9]*'); + if (contents !== newContents) { + writeFileSync(filePath, newContents, 'utf8'); + console.log(`Release tag matcher for snapshots replaced in ${filePath}`); + } else { + console.log(`Release tag matcher for snapshots were already replaced in ${filePath}`); + } +}); + + log('===== finished running the postinstall-patches.js script =====');