@agilecustoms/envctl 0.22.1 → 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.
- package/dist/service/EnvCtl.js +18 -20
- package/package.json +1 -1
package/dist/service/EnvCtl.js
CHANGED
|
@@ -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,23 +155,27 @@ export class EnvCtl {
|
|
|
161
155
|
await this.envApi.activate(env);
|
|
162
156
|
}
|
|
163
157
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
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
|
}
|
|
174
|
+
await this.promptUnlock(env);
|
|
175
|
+
if (env.status !== EnvStatus.Active) {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
console.log('Deleting env');
|
|
181
179
|
const message = await this.envApi.delete(env);
|
|
182
180
|
console.log(message);
|
|
183
181
|
}
|