Skip to content

Commit f60e6e9

Browse files
authored
1 parent 432f97d commit f60e6e9

File tree

1 file changed

+1
-41
lines changed

1 file changed

+1
-41
lines changed

packages/aws-cdk/lib/cdk-toolkit.ts

+1-41
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ import * as cxapi from '@aws-cdk/cx-api';
44
import * as chalk from 'chalk';
55
import * as chokidar from 'chokidar';
66
import * as fs from 'fs-extra';
7-
import { minimatch } from 'minimatch';
87
import * as promptly from 'promptly';
9-
import * as semver from 'semver';
108
import * as uuid from 'uuid';
119
import { DeploymentMethod } from './api';
1210
import { SdkProvider } from './api/aws-auth';
@@ -31,7 +29,6 @@ import { validateSnsTopicArn } from './util/validate-notification-arn';
3129
import { Concurrency, WorkGraph } from './util/work-graph';
3230
import { WorkGraphBuilder } from './util/work-graph-builder';
3331
import { AssetBuildNode, AssetPublishNode, StackNode } from './util/work-graph-types';
34-
import { versionNumber } from './version';
3532
import { environmentsFromDescriptors, globEnvironmentsFromStacks, looksLikeGlob } from '../lib/api/cxapp/environments';
3633

3734
export interface CdkToolkitProps {
@@ -617,9 +614,6 @@ export class CdkToolkit {
617614
stacks = stacks.reversed();
618615

619616
if (!options.force) {
620-
if (stacks.stackArtifacts.length === 0) {
621-
return;
622-
}
623617
// eslint-disable-next-line max-len
624618
const confirmed = await promptly.confirm(`Are you sure you want to delete: ${chalk.blue(stacks.stackArtifacts.map(s => s.hierarchicalId).join(', '))} (y/n)?`);
625619
if (!confirmed) {
@@ -913,43 +907,9 @@ export class CdkToolkit {
913907
extend: exclusively ? ExtendedStackSelection.None : ExtendedStackSelection.Downstream,
914908
defaultBehavior: DefaultSelection.OnlySingle,
915909
});
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-
});
925910

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
946912

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-
});
953913
return stacks;
954914
}
955915

0 commit comments

Comments
 (0)