From 75ff203020fe0e61c5fb0fe6706d5775584459a3 Mon Sep 17 00:00:00 2001 From: Ammar <56042290+ammarkarachi@users.noreply.github.com> Date: Sat, 6 Nov 2021 17:12:52 -0700 Subject: [PATCH] fix: fix configure project and custom policies api containers (#8703) --- packages/amplify-cli/src/input-manager.ts | 8 +++++++- packages/amplify-e2e-core/src/categories/api.ts | 2 +- .../amplify-plugin.json | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/amplify-cli/src/input-manager.ts b/packages/amplify-cli/src/input-manager.ts index 6a17be6956f..8c6098ef3e9 100644 --- a/packages/amplify-cli/src/input-manager.ts +++ b/packages/amplify-cli/src/input-manager.ts @@ -10,7 +10,7 @@ export function getCommandLineInput(pluginPlatform: PluginPlatform): Input { /* tslint:disable */ if (result.argv && result.argv.length > 2) { let index = 2; - + aliasArgs(result.argv); // pick up plugin name, allow plugin name to be in the 2nd or 3rd position const pluginNames = getAllPluginNames(pluginPlatform); @@ -193,3 +193,9 @@ export function verifyInput(pluginPlatform: PluginPlatform, input: Input): Input return result; } + +function aliasArgs(argv: string[]) { + if (argv.length >= 4 && argv[2] === 'override' && argv[3] === 'project') { + argv[3] = 'root'; + } +} diff --git a/packages/amplify-e2e-core/src/categories/api.ts b/packages/amplify-e2e-core/src/categories/api.ts index e7bbb8fc8d7..38ede84c8a3 100644 --- a/packages/amplify-e2e-core/src/categories/api.ts +++ b/packages/amplify-e2e-core/src/categories/api.ts @@ -719,7 +719,7 @@ export function rebuildApi(projDir: string, apiName: string) { export function addRestContainerApiForCustomPolicies(projectDir: string, settings: { name: string }) { return new Promise((resolve, reject) => { spawn(getCLIPath(), ['add', 'api'], { cwd: projectDir, stripColors: true }) - .wait('Please select from one of the below mentioned services:') + .wait('Select from one of the below mentioned services:') .sendKeyDown() .sendCarriageReturn() .wait('Which service would you like to use') diff --git a/packages/amplify-provider-awscloudformation/amplify-plugin.json b/packages/amplify-provider-awscloudformation/amplify-plugin.json index 9a51a23bbd9..618886f0046 100644 --- a/packages/amplify-provider-awscloudformation/amplify-plugin.json +++ b/packages/amplify-provider-awscloudformation/amplify-plugin.json @@ -1,6 +1,6 @@ { "name": "awscloudformation", - "aliases": ["awscfn", "aws", "root", "project"], + "aliases": ["awscfn", "aws", "root"], "type": "provider", "commands": ["configure", "console", "reset-cache", "setupNewUser", "help", "override"], "commandAliases": {