Commit 013a3ea 1 parent bd9fd1c commit 013a3ea Copy full SHA for 013a3ea
File tree 2 files changed +7
-5
lines changed
packages/@angular/cli/utilities
2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ export default function findParentModule(
26
26
if ( files . length === 1 ) {
27
27
return path . join ( pathToCheck , files [ 0 ] ) ;
28
28
} else if ( files . length > 1 ) {
29
- throw new SilentError ( `Multiple module files found: ${ pathToCheck . replace ( sourceRoot , '' ) } ` ) ;
29
+ throw new SilentError ( `Multiple module files found: ${ JSON . stringify ( files ) } ` ) ;
30
30
}
31
31
32
32
// move to parent directory
Original file line number Diff line number Diff line change @@ -7,17 +7,19 @@ export function resolveModulePath(
7
7
let baseModuleName = moduleNameFromFlag ;
8
8
let parentFolders = '' ;
9
9
10
+ // If it's a full path from the cwd, we use it as is.
11
+ if ( fs . existsSync ( moduleNameFromFlag ) && fs . statSync ( moduleNameFromFlag ) . isFile ( ) ) {
12
+ return path . resolve ( moduleNameFromFlag ) ;
13
+ }
14
+
10
15
if ( baseModuleName . includes ( path . sep ) ) {
11
16
const splitPath = baseModuleName . split ( path . sep ) ;
12
17
baseModuleName = splitPath . pop ( ) ;
13
18
parentFolders = splitPath . join ( path . sep ) ;
14
19
}
15
20
16
21
if ( baseModuleName . includes ( '.' ) ) {
17
- baseModuleName = baseModuleName
18
- . split ( '.' )
19
- . filter ( part => part !== 'module' && part !== 'ts' )
20
- . join ( '.' ) ;
22
+ baseModuleName = baseModuleName . replace ( / ( \. m o d u l e ) ? ( \. t s ) ? $ / , '' ) ;
21
23
}
22
24
23
25
const baseModuleWithFileSuffix = `${ baseModuleName } .module.ts` ;
You can’t perform that action at this time.
0 commit comments