Commit 0a464ea 1 parent 4f1c37b commit 0a464ea Copy full SHA for 0a464ea
File tree 4 files changed +20
-3
lines changed
packages/@angular/cli/tasks
tests/e2e/tests/commands/build
4 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export default Task.extend({
20
20
const app = getAppFromConfig ( runTaskOptions . app ) ;
21
21
22
22
const outputPath = runTaskOptions . outputPath || app . outDir ;
23
- if ( this . project . root === outputPath ) {
23
+ if ( this . project . root === path . resolve ( outputPath ) ) {
24
24
throw new SilentError ( 'Output path MUST not be project root directory!' ) ;
25
25
}
26
26
if ( config . project && config . project . ejected ) {
Original file line number Diff line number Diff line change @@ -397,7 +397,7 @@ export default Task.extend({
397
397
const outputPath = runTaskOptions . outputPath || appConfig . outDir ;
398
398
const force = runTaskOptions . force ;
399
399
400
- if ( project . root === outputPath ) {
400
+ if ( project . root === path . resolve ( outputPath ) ) {
401
401
throw new SilentError ( 'Output path MUST not be project root directory!' ) ;
402
402
}
403
403
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ export default Task.extend({
25
25
const appConfig = getAppFromConfig ( serveTaskOptions . app ) ;
26
26
27
27
const outputPath = serveTaskOptions . outputPath || appConfig . outDir ;
28
- if ( this . project . root === outputPath ) {
28
+ if ( this . project . root === path . resolve ( outputPath ) ) {
29
29
throw new SilentError ( 'Output path MUST not be project root directory!' ) ;
30
30
}
31
31
if ( projectConfig . project && projectConfig . project . ejected ) {
Original file line number Diff line number Diff line change
1
+ import { ng } from '../../../utils/process' ;
2
+ import { updateJsonFile } from '../../../utils/project' ;
3
+ import { expectToFail } from '../../../utils/utils' ;
4
+
5
+ export default function ( ) {
6
+ return Promise . resolve ( )
7
+ . then ( ( ) => updateJsonFile ( '.angular-cli.json' , configJson => {
8
+ const app = configJson [ 'apps' ] [ 0 ] ;
9
+ app [ 'outDir' ] = './' ;
10
+ } ) )
11
+ . then ( ( ) => expectToFail ( ( ) => ng ( 'build' ) ) )
12
+ . then ( ( ) => expectToFail ( ( ) => ng ( 'serve' ) ) )
13
+ . then ( ( ) => expectToFail ( ( ) => ng ( 'eject' ) ) ) ;
14
+ }
15
+
16
+
17
+
You can’t perform that action at this time.
0 commit comments