@agilecustoms/envctl 0.22.0 → 0.22.2

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.
@@ -148,12 +148,6 @@ export class EnvCtl {
148
148
  }
149
149
  async delete(project, envName, force, cwd) {
150
150
  const env = await this.get(project, envName);
151
- this.checkStatus(env);
152
- if (env.status === EnvStatus.Init) {
153
- await this.envApi.delete(env);
154
- console.log(`Env ${env.key} is deleted`);
155
- return;
156
- }
157
151
  if (force) {
158
152
  console.log('Force deletion');
159
153
  if (env.status === EnvStatus.Deploying || env.status === EnvStatus.Updating) {
@@ -161,25 +155,29 @@ export class EnvCtl {
161
155
  await this.envApi.activate(env);
162
156
  }
163
157
  }
164
- else {
165
- const kind = this.cliHelper.ensureKind(undefined, cwd);
166
- if (env.kind && env.kind !== kind) {
167
- const answerYes = await this.cliHelper.promptYesNo(`Env ${env.key} kind (dir-name): ${env.kind}\n`
168
- + 'You\'re deleting env deployed from different dir\n'
169
- + 'Do you want to proceed?');
170
- if (!answerYes) {
171
- console.log('Aborting deletion');
172
- return;
173
- }
174
- }
175
- await this.promptUnlock(env);
176
- if (env.status !== EnvStatus.Active) {
158
+ this.checkStatus(env);
159
+ if (env.status === EnvStatus.Init) {
160
+ await this.envApi.delete(env);
161
+ console.log(`Env ${env.key} is deleted`);
162
+ return;
163
+ }
164
+ const kind = this.cliHelper.ensureKind(undefined, cwd);
165
+ if (env.kind && env.kind !== kind) {
166
+ const answerYes = await this.cliHelper.promptYesNo(`Env ${env.key} kind (dir-name): ${env.kind}\n`
167
+ + 'You\'re deleting env deployed from different dir\n'
168
+ + 'Do you want to proceed?');
169
+ if (!answerYes) {
170
+ console.log('Aborting deletion');
177
171
  return;
178
172
  }
179
- console.log('Deleting env');
180
173
  }
181
- await this.envApi.delete(env);
182
- console.log(`Env ${env.key} is scheduled for deletion`);
174
+ await this.promptUnlock(env);
175
+ if (env.status !== EnvStatus.Active) {
176
+ return;
177
+ }
178
+ console.log('Deleting env');
179
+ const message = await this.envApi.delete(env);
180
+ console.log(message);
183
181
  }
184
182
  async destroy(project, envName, tfArgs, force, cwd) {
185
183
  const env = await this.get(project, envName);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@agilecustoms/envctl",
3
3
  "description": "node.js CLI client for manage environments",
4
- "version": "0.22.0",
4
+ "version": "0.22.2",
5
5
  "author": "Alex Chekulaev",
6
6
  "type": "module",
7
7
  "bin": {