Skip to content

Commit

Permalink
build: patch snapshot issue in dev-infra selecting the latest version…
Browse files Browse the repository at this point in the history
… tag

Local patch ahead of landing of angular/dev-infra#449
  • Loading branch information
josephperrott committed Mar 4, 2022
1 parent 9b1e9c0 commit 48c7b09
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion tools/postinstall-patches.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -172,4 +172,20 @@ 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');
log(`Release tag matcher for snapshots replaced in ${filePath}`);
} else {
log(`Release tag matcher for snapshots were already replaced in ${filePath}`);
}
});


log('===== finished running the postinstall-patches.js script =====');

0 comments on commit 48c7b09

Please sign in to comment.