Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Sep 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.