File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
tests/legacy-cli/e2e/tests/build Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 11import { getGlobalVariable } from '../../utils/env' ;
2- import { replaceInFile } from '../../utils/fs' ;
2+ import { readFile , replaceInFile } from '../../utils/fs' ;
33import { installPackage , installWorkspacePackages } from '../../utils/packages' ;
44import { ng } from '../../utils/process' ;
55import { isPrereleaseCli , updateJsonFile } from '../../utils/project' ;
66
77const snapshots = require ( '../../ng-snapshot/package.json' ) ;
88
99export default async function ( ) {
10- const tag = await isPrereleaseCli ( ) ? '@next' : '' ;
10+ let tag = ( await isPrereleaseCli ( ) ) ? '@next' : '' ;
1111 await ng ( 'add' , `@angular/material${ tag } ` , '--skip-confirmation' ) ;
1212
1313 const isSnapshotBuild = getGlobalVariable ( 'argv' ) [ 'ng-snapshots' ] ;
@@ -25,10 +25,15 @@ export default async function () {
2525 dependencies [ '@angular/material-moment-adapter' ] =
2626 snapshots . dependencies [ '@angular/material-moment-adapter' ] ;
2727 } ) ;
28-
2928 await installWorkspacePackages ( ) ;
3029 } else {
31- await installPackage ( '@angular/material-moment-adapter' ) ;
30+ if ( ! tag ) {
31+ const installedMaterialVersion = JSON . parse ( await readFile ( 'package.json' ) ) [ 'dependencies' ] [
32+ '@angular/material'
33+ ] ;
34+ tag = `@${ installedMaterialVersion } ` ;
35+ }
36+ await installPackage ( `@angular/material-moment-adapter${ tag } ` ) ;
3237 }
3338
3439 await installPackage ( 'moment' ) ;
You can’t perform that action at this time.
0 commit comments