Commit d27fc7e 1 parent c7f994f commit d27fc7e Copy full SHA for d27fc7e
File tree 1 file changed +9
-4
lines changed
tests/legacy-cli/e2e/tests/build
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 1
1
import { getGlobalVariable } from '../../utils/env' ;
2
- import { replaceInFile } from '../../utils/fs' ;
2
+ import { readFile , replaceInFile } from '../../utils/fs' ;
3
3
import { installPackage , installWorkspacePackages } from '../../utils/packages' ;
4
4
import { ng } from '../../utils/process' ;
5
5
import { isPrereleaseCli , updateJsonFile } from '../../utils/project' ;
6
6
7
7
const snapshots = require ( '../../ng-snapshot/package.json' ) ;
8
8
9
9
export default async function ( ) {
10
- const tag = await isPrereleaseCli ( ) ? '@next' : '' ;
10
+ let tag = ( await isPrereleaseCli ( ) ) ? '@next' : '' ;
11
11
await ng ( 'add' , `@angular/material${ tag } ` , '--skip-confirmation' ) ;
12
12
13
13
const isSnapshotBuild = getGlobalVariable ( 'argv' ) [ 'ng-snapshots' ] ;
@@ -25,10 +25,15 @@ export default async function () {
25
25
dependencies [ '@angular/material-moment-adapter' ] =
26
26
snapshots . dependencies [ '@angular/material-moment-adapter' ] ;
27
27
} ) ;
28
-
29
28
await installWorkspacePackages ( ) ;
30
29
} 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 } ` ) ;
32
37
}
33
38
34
39
await installPackage ( 'moment' ) ;
You can’t perform that action at this time.
0 commit comments