Commit 6c19f26 1 parent 7ce88c7 commit 6c19f26 Copy full SHA for 6c19f26
File tree 1 file changed +8
-3
lines changed
tests/legacy-cli/e2e/tests/build
1 file changed +8
-3
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,9 +25,14 @@ 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 {
30
+ if ( ! tag ) {
31
+ const installedMaterialVersion = JSON . parse ( await readFile ( 'package.json' ) ) [ 'dependencies' ] [
32
+ 'angular/material'
33
+ ] ;
34
+ tag = `@${ installedMaterialVersion } ` ;
35
+ }
31
36
await installPackage ( `@angular/material-moment-adapter${ tag } ` ) ;
32
37
}
33
38
You can’t perform that action at this time.
0 commit comments