Skip to content

Commit

Permalink
Revert "fix(cli): better error message when trying to publish with CD…
Browse files Browse the repository at this point in the history
… configured in Amplify Console (aws-amplify#7874) (aws-amplify#8106)

* Revert "fix: handle case where there is no appId (aws-amplify#8049)"

This reverts commit f7e62df.

The commit being reverted builds on top of another commit that
is being reverted.

* Revert "fix(cli): better error message when trying to publish with CD configured in Amplify Console (aws-amplify#7874)"

This reverts commit 4f03859.

The commit being reverted causes a number of customer bug reports
in verion 5.4.0.

Co-authored-by: Colin Ihrig <colihrig@amazon.com>
  • Loading branch information
2 people authored and marcvberg committed Oct 13, 2021
1 parent 2e99a7f commit 2cabeb9
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 63 deletions.
37 changes: 0 additions & 37 deletions packages/amplify-cli/src/__tests__/utils/check-hosting.test.ts

This file was deleted.

12 changes: 1 addition & 11 deletions packages/amplify-cli/src/commands/publish.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
import { run as push } from './push';
import { FrontendBuildError } from 'amplify-cli-core';
import { hasCdBranches } from '../utils/check-hosting';

export const run = async context => {
context.amplify.constructExeInfo(context);
const { amplifyMeta } = context.exeInfo;
const isHostingAdded = amplifyMeta.hosting && Object.keys(amplifyMeta.hosting).length > 0;

// Stop if the user has Continuous Deployment set up in the Amplify Console.
if (await hasCdBranches(context)) {
context.print.info('');
context.print.error(
'You have already connected branches to your Amplify Console app. Please visit the Amplify Console to manage your branches.',
);
context.print.info('');
return;
// Otherwise, stop if the user has not added the hosting category.
} else if (!isHostingAdded) {
if (!isHostingAdded) {
context.print.info('');
context.print.error('Please add hosting to your project before publishing your project');
context.print.info('Command: amplify hosting add');
Expand Down
15 changes: 0 additions & 15 deletions packages/amplify-cli/src/utils/check-hosting.ts

This file was deleted.

0 comments on commit 2cabeb9

Please sign in to comment.