File tree Expand file tree Collapse file tree 4 files changed +20
-3
lines changed
packages/@angular/cli/tasks
tests/e2e/tests/commands/build Expand file tree Collapse file tree 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({
2020 const app = getAppFromConfig ( runTaskOptions . app ) ;
2121
2222 const outputPath = runTaskOptions . outputPath || app . outDir ;
23- if ( this . project . root === outputPath ) {
23+ if ( this . project . root === path . resolve ( outputPath ) ) {
2424 throw new SilentError ( 'Output path MUST not be project root directory!' ) ;
2525 }
2626 if ( config . project && config . project . ejected ) {
Original file line number Diff line number Diff line change @@ -397,7 +397,7 @@ export default Task.extend({
397397 const outputPath = runTaskOptions . outputPath || appConfig . outDir ;
398398 const force = runTaskOptions . force ;
399399
400- if ( project . root === outputPath ) {
400+ if ( project . root === path . resolve ( outputPath ) ) {
401401 throw new SilentError ( 'Output path MUST not be project root directory!' ) ;
402402 }
403403
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ export default Task.extend({
2525 const appConfig = getAppFromConfig ( serveTaskOptions . app ) ;
2626
2727 const outputPath = serveTaskOptions . outputPath || appConfig . outDir ;
28- if ( this . project . root === outputPath ) {
28+ if ( this . project . root === path . resolve ( outputPath ) ) {
2929 throw new SilentError ( 'Output path MUST not be project root directory!' ) ;
3030 }
3131 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