@@ -163,11 +163,10 @@ export class Source extends SfCommand<DeleteSourceJson> {
163
163
}
164
164
}
165
165
166
+ // eslint-disable-next-line complexity
166
167
protected async delete ( ) : Promise < void > {
167
168
const sourcepaths = this . flags [ 'source-dir' ] ;
168
- const retrieveFromOrg = this . flags . metadata ?. some ( isPseudoType )
169
- ? this . flags [ 'target-org' ] . getUsername ( )
170
- : undefined ;
169
+ const resolveFromOrg = this . flags . metadata ?. some ( isPseudoType ) ? this . flags [ 'target-org' ] . getUsername ( ) : undefined ;
171
170
172
171
this . componentSet = await ComponentSetBuilder . build ( {
173
172
apiversion : this . flags [ 'api-version' ] ,
@@ -180,8 +179,18 @@ export class Source extends SfCommand<DeleteSourceJson> {
180
179
}
181
180
: undefined ,
182
181
projectDir : this . project ?. getPath ( ) ,
183
- ...( retrieveFromOrg ? { org : { username : retrieveFromOrg , exclude : [ ] } } : { } ) ,
182
+ ...( resolveFromOrg ? { org : { username : resolveFromOrg , exclude : [ ] } } : { } ) ,
184
183
} ) ;
184
+
185
+ // If we built a component set from an org connection, we have to resolve
186
+ // components from the project.
187
+ if ( resolveFromOrg ) {
188
+ this . componentSet = ComponentSet . fromSource ( {
189
+ fsPaths : await getPackageDirs ( ) ,
190
+ include : this . componentSet ,
191
+ } ) ;
192
+ }
193
+
185
194
if ( this . flags [ 'track-source' ] && ! this . flags [ 'force-overwrite' ] ) {
186
195
await this . filterConflictsByComponentSet ( ) ;
187
196
}
0 commit comments