@@ -4,9 +4,7 @@ import * as cxapi from '@aws-cdk/cx-api';
4
4
import * as chalk from 'chalk' ;
5
5
import * as chokidar from 'chokidar' ;
6
6
import * as fs from 'fs-extra' ;
7
- import { minimatch } from 'minimatch' ;
8
7
import * as promptly from 'promptly' ;
9
- import * as semver from 'semver' ;
10
8
import * as uuid from 'uuid' ;
11
9
import { DeploymentMethod } from './api' ;
12
10
import { SdkProvider } from './api/aws-auth' ;
@@ -31,7 +29,6 @@ import { validateSnsTopicArn } from './util/validate-notification-arn';
31
29
import { Concurrency , WorkGraph } from './util/work-graph' ;
32
30
import { WorkGraphBuilder } from './util/work-graph-builder' ;
33
31
import { AssetBuildNode , AssetPublishNode , StackNode } from './util/work-graph-types' ;
34
- import { versionNumber } from './version' ;
35
32
import { environmentsFromDescriptors , globEnvironmentsFromStacks , looksLikeGlob } from '../lib/api/cxapp/environments' ;
36
33
37
34
export interface CdkToolkitProps {
@@ -617,9 +614,6 @@ export class CdkToolkit {
617
614
stacks = stacks . reversed ( ) ;
618
615
619
616
if ( ! options . force ) {
620
- if ( stacks . stackArtifacts . length === 0 ) {
621
- return ;
622
- }
623
617
// eslint-disable-next-line max-len
624
618
const confirmed = await promptly . confirm ( `Are you sure you want to delete: ${ chalk . blue ( stacks . stackArtifacts . map ( s => s . hierarchicalId ) . join ( ', ' ) ) } (y/n)?` ) ;
625
619
if ( ! confirmed ) {
@@ -913,43 +907,9 @@ export class CdkToolkit {
913
907
extend : exclusively ? ExtendedStackSelection . None : ExtendedStackSelection . Downstream ,
914
908
defaultBehavior : DefaultSelection . OnlySingle ,
915
909
} ) ;
916
- const selectorWithoutPatterns : StackSelector = {
917
- ...selector ,
918
- allTopLevel : true ,
919
- patterns : [ ] ,
920
- } ;
921
- const stacksWithoutPatterns = await assembly . selectStacks ( selectorWithoutPatterns , {
922
- extend : exclusively ? ExtendedStackSelection . None : ExtendedStackSelection . Downstream ,
923
- defaultBehavior : DefaultSelection . OnlySingle ,
924
- } ) ;
925
910
926
- const patterns = selector . patterns . map ( pattern => {
927
- const notExist = ! stacks . stackArtifacts . find ( stack =>
928
- minimatch ( stack . hierarchicalId , pattern ) || ( stack . id === pattern && semver . major ( versionNumber ( ) ) < 2 ) ,
929
- ) ;
930
-
931
- const closelyMatched = notExist ? stacksWithoutPatterns . stackArtifacts . map ( stack => {
932
- if ( minimatch ( stack . hierarchicalId . toLowerCase ( ) , pattern . toLowerCase ( ) ) ) {
933
- return stack . hierarchicalId ;
934
- }
935
- if ( stack . id . toLowerCase ( ) === pattern . toLowerCase ( ) && semver . major ( versionNumber ( ) ) < 2 ) {
936
- return stack . id ;
937
- }
938
- return ;
939
- } ) . filter ( ( stack ) : stack is string => stack !== undefined ) : [ ] ;
940
- return {
941
- pattern,
942
- notExist,
943
- closelyMatched,
944
- } ;
945
- } ) ;
911
+ // No validation
946
912
947
- patterns . forEach ( pattern => {
948
- if ( pattern . notExist ) {
949
- const closelyMatched = pattern . closelyMatched . length > 0 ? ` Do you mean ${ pattern . closelyMatched . join ( ', ' ) } ?` : '' ;
950
- warning ( `${ pattern . pattern } does not exist.${ closelyMatched } ` ) ;
951
- }
952
- } ) ;
953
913
return stacks ;
954
914
}
955
915
0 commit comments