Skip to content

Commit bc89598

Browse files
josephperrottAndrewKushnir
authored andcommitted
build: patch snapshot issue in dev-infra selecting the latest version tag (angular#45269)
Local patch ahead of landing of angular/dev-infra#449 PR Close angular#45269
1 parent 9b1e9c0 commit bc89598

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

tools/postinstall-patches.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ try {
2121
}
2222

2323
const {set, cd, sed, echo, ls, rm} = require('shelljs');
24-
const {readFileSync} = require('fs');
24+
const {readFileSync, writeFileSync} = require('fs');
2525
const path = require('path');
2626
const log = console.info;
2727

@@ -172,4 +172,20 @@ rm('-rf', [
172172
]);
173173

174174

175+
log('\n# patch: dev-infra snapshotting');
176+
// more info in https://github.com/angular/dev-infra/pull/449
177+
['node_modules/@angular/dev-infra-private/ng-dev/bundles/cli.js',
178+
'node_modules/@angular/dev-infra-private/ng-dev/bundles/cli.js.map',
179+
].forEach(filePath => {
180+
const contents = readFileSync(filePath, 'utf8');
181+
const newContents = contents.replace('*[0-9]*.[0-9]*.[0-9]*', '?[0-9]*.[0-9]*.[0-9]*');
182+
if (contents !== newContents) {
183+
writeFileSync(filePath, newContents, 'utf8');
184+
log(`Release tag matcher for snapshots replaced in ${filePath}`);
185+
} else {
186+
log(`Release tag matcher for snapshots were already replaced in ${filePath}`);
187+
}
188+
});
189+
190+
175191
log('===== finished running the postinstall-patches.js script =====');

0 commit comments

Comments
 (0)