@@ -15,6 +15,7 @@ import { experimental, json, schema, tags } from '@angular-devkit/core';
15
15
import { NodeJsSyncHost , createConsoleLogger } from '@angular-devkit/core/node' ;
16
16
import { from } from 'rxjs' ;
17
17
import { concatMap , map , tap , toArray } from 'rxjs/operators' ;
18
+ import { getProjectByCwd } from '../utilities/config' ;
18
19
import { parseJsonSchemaToOptions } from '../utilities/json-schema' ;
19
20
import { BaseCommandOptions , Command } from './command' ;
20
21
import { Arguments } from './interface' ;
@@ -212,11 +213,11 @@ export abstract class ArchitectCommand<
212
213
// For multi target commands, we always list all projects that have the target.
213
214
return allProjectsForTargetName ;
214
215
} else {
215
- // For single target commands, we try the default project first,
216
+ // For single target commands, we try the current project first,
216
217
// then the full list if it has a single project, then error out.
217
- const maybeDefaultProject = this . _workspace . getDefaultProjectName ( ) ;
218
- if ( maybeDefaultProject && allProjectsForTargetName . includes ( maybeDefaultProject ) ) {
219
- return [ maybeDefaultProject ] ;
218
+ const maybeCurrentProject = getProjectByCwd ( this . _workspace , this . logger ) ;
219
+ if ( maybeCurrentProject && allProjectsForTargetName . includes ( maybeCurrentProject ) ) {
220
+ return [ maybeCurrentProject ] ;
220
221
}
221
222
222
223
if ( allProjectsForTargetName . length === 1 ) {
0 commit comments