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

Svn main 001 rem #6489

Merged
merged 18 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Next Next commit
Change name from stack to backend
  • Loading branch information
svnsairam committed Nov 1, 2023
commit a02cc2c75a78535d02a0a1fd4f6eefdf91a93ba4
4 changes: 2 additions & 2 deletions src/commands/frameworks-stacks-create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { needProjectId } from "../projectUtils";
import requireInteractive from "../requireInteractive";
import { doSetup } from "../init/features/frameworks";

export const command = new Command("stacks:create")
.description("Create a stack in a Firebase project")
export const command = new Command("backends:create")
.description("Create a backend in a Firebase project")
.before(requireInteractive)
.action(async (options: Options) => {
const projectId = needProjectId(options);
Expand Down
20 changes: 10 additions & 10 deletions src/commands/frameworks-stacks-delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@ import * as gcp from "../gcp/frameworks";
import { promptOnce } from "../prompt";
import * as utils from "../utils";

export const command = new Command("stacks:delete")
.description("Delete a stack from a Firebase project")
export const command = new Command("backends:delete")
.description("Delete a backend from a Firebase project")
.option("-l, --location <location>", "App Backend location", "us-central1")
.option("-s, --stackId <stackId>", "Stack Id", "")
.option("-s, --backendId <backendId>", "Backend Id", "")
.withForce()
.action(async (options: Options) => {
const projectId = needProjectId(options);
const location = options.location as string;
const stackId = options.stackId as string;
if (!stackId) {
throw new FirebaseError("Stack id can't be empty.");
const backendId = options.backendId as string;
if (!backendId) {
throw new FirebaseError("Backend id can't be empty.");
}
const confirmDeletion = await promptOnce(
{
type: "confirm",
name: "force",
default: false,
message: "You are about to delete the Stack with id: " + stackId + "\n Are you sure?",
message: "You are about to delete the Backend with id: " + backendId + "\n Are you sure?",
},
options
);
Expand All @@ -32,11 +32,11 @@ export const command = new Command("stacks:delete")
}

try {
await gcp.deleteStack(projectId, location, stackId);
utils.logSuccess(`Successfully deleted the stack: ${stackId}`);
await gcp.deleteStack(projectId, location, backendId);
utils.logSuccess(`Successfully deleted the backend: ${backendId}`);
} catch (err: any) {
throw new FirebaseError(
`Failed to delete stack: ${stackId}. Please check the parameters you have provided.`,
`Failed to delete backend: ${backendId}. Please check the parameters you have provided.`,
{ original: err }
);
}
Expand Down