@stoker-platform/cli 0.5.92 → 0.5.93

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,4 @@
1
+ import { input } from "@inquirer/prompts";
1
2
  import { runChildProcess } from "@stoker-platform/node-client";
2
3
  import { readFile, rm, unlink, writeFile } from "fs/promises";
3
4
  import { existsSync } from "fs";
@@ -6,6 +7,14 @@ export const deleteProject = async (options) => {
6
7
  if (!process.env.GCP_PROJECT) {
7
8
  throw new Error("GCP_PROJECT is not set.");
8
9
  }
10
+ const projectName = process.env.GCP_PROJECT;
11
+ const confirmation = await input({
12
+ message: `Type the project name "${projectName}" to confirm deletion:`,
13
+ validate: (value) => value.trim().toLowerCase() === projectName.toLowerCase() || "Project name does not match.",
14
+ });
15
+ if (confirmation.trim().toLowerCase() !== projectName.toLowerCase()) {
16
+ throw new Error("Project name does not match. Deletion cancelled.");
17
+ }
9
18
  await runChildProcess("gcloud", ["projects", "delete", process.env.GCP_PROJECT, "--quiet"]).catch(() => {
10
19
  throw new Error("Error deleting project.");
11
20
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stoker-platform/cli",
3
- "version": "0.5.92",
3
+ "version": "0.5.93",
4
4
  "type": "module",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "main": "./lib/src/main.js",