diff --git a/packages/aws-cdk/bin/cdk.ts b/packages/aws-cdk/bin/cdk.ts index ba03e0943bb6b..91f0ebffe3919 100644 --- a/packages/aws-cdk/bin/cdk.ts +++ b/packages/aws-cdk/bin/cdk.ts @@ -3,7 +3,6 @@ import 'source-map-support/register'; import colors = require('colors/safe'); import fs = require('fs-extra'); -import util = require('util'); import yargs = require('yargs'); import { bootstrapEnvironment, destroyStack, SDK } from '../lib'; @@ -25,7 +24,6 @@ import { VERSION } from '../lib/version'; // tslint:disable-next-line:no-var-requires const promptly = require('promptly'); -const confirm = util.promisify(promptly.confirm); // tslint:disable:no-shadowed-variable max-line-length async function parseCommandLineArguments() { @@ -359,7 +357,7 @@ async function initCommandLine() { if (!force) { // tslint:disable-next-line:max-line-length - const confirmed = await confirm(`Are you sure you want to delete: ${colors.blue(stacks.map(s => s.name).join(', '))} (y/n)?`); + const confirmed = await promptly.confirm(`Are you sure you want to delete: ${colors.blue(stacks.map(s => s.name).join(', '))} (y/n)?`); if (!confirmed) { return; } diff --git a/packages/aws-cdk/lib/cdk-toolkit.ts b/packages/aws-cdk/lib/cdk-toolkit.ts index 1aad96c3b8b81..500c7d2bb9fc8 100644 --- a/packages/aws-cdk/lib/cdk-toolkit.ts +++ b/packages/aws-cdk/lib/cdk-toolkit.ts @@ -1,6 +1,6 @@ import colors = require('colors/safe'); import fs = require('fs-extra'); -import { format, promisify } from 'util'; +import { format } from 'util'; import { AppStacks, ExtendedStackSelection } from "./api/cxapp/stacks"; import { IDeploymentTarget } from './api/deployment-target'; import { printSecurityDiff, printStackDiff, RequireApproval } from './diff'; @@ -9,7 +9,6 @@ import { deserializeStructure } from './serialize'; // tslint:disable-next-line:no-var-requires const promptly = require('promptly'); -const confirm = promisify(promptly.confirm); export interface CdkToolkitProps { /** @@ -98,7 +97,7 @@ export class CdkToolkit { 'but terminal (TTY) is not attached so we are unable to get a confirmation from the user'); } - const confirmed = await confirm(`Do you wish to deploy these changes (y/n)?`); + const confirmed = await promptly.confirm(`Do you wish to deploy these changes (y/n)?`); if (!confirmed) { throw new Error('Aborted by user'); } } } @@ -230,4 +229,4 @@ export interface DeployOptions { * Reuse the assets with the given asset IDs */ reuseAssets?: string[]; -} \ No newline at end of file +}