@agilecustoms/envctl 0.22.1 → 0.22.3
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.
- package/dist/service/EnvCtl.js +7 -14
- package/package.json +1 -1
package/dist/service/EnvCtl.js
CHANGED
|
@@ -148,20 +148,13 @@ export class EnvCtl {
|
|
|
148
148
|
}
|
|
149
149
|
async delete(project, envName, force, cwd) {
|
|
150
150
|
const env = await this.get(project, envName);
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
if (force) {
|
|
158
|
-
console.log('Force deletion');
|
|
159
|
-
if (env.status === EnvStatus.Deploying || env.status === EnvStatus.Updating) {
|
|
160
|
-
console.log(`Env status is ${env.status}, will unlock it`);
|
|
161
|
-
await this.envApi.activate(env);
|
|
151
|
+
if (!force) {
|
|
152
|
+
this.checkStatus(env);
|
|
153
|
+
if (env.status === EnvStatus.Init) {
|
|
154
|
+
await this.envApi.delete(env);
|
|
155
|
+
console.log(`Env ${env.key} is deleted`);
|
|
156
|
+
return;
|
|
162
157
|
}
|
|
163
|
-
}
|
|
164
|
-
else {
|
|
165
158
|
const kind = this.cliHelper.ensureKind(undefined, cwd);
|
|
166
159
|
if (env.kind && env.kind !== kind) {
|
|
167
160
|
const answerYes = await this.cliHelper.promptYesNo(`Env ${env.key} kind (dir-name): ${env.kind}\n`
|
|
@@ -176,8 +169,8 @@ export class EnvCtl {
|
|
|
176
169
|
if (env.status !== EnvStatus.Active) {
|
|
177
170
|
return;
|
|
178
171
|
}
|
|
179
|
-
console.log('Deleting env');
|
|
180
172
|
}
|
|
173
|
+
console.log('Deleting env');
|
|
181
174
|
const message = await this.envApi.delete(env);
|
|
182
175
|
console.log(message);
|
|
183
176
|
}
|