Skip to content

Commit 7647fa0

Browse files
Vikram KaltaVikram Kalta
authored andcommitted
feat: added support to uninstall app from multi locations
1 parent 78d344c commit 7647fa0

File tree

5 files changed

+8
-24
lines changed

5 files changed

+8
-24
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ dependabot.yml
1717
/bkp
1818
.editorconfig
1919
oclif.manifest.json
20-
*.env
20+
*.env
21+
.vscode/

.vscode/launch.json

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/commands/app/uninstall.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ export default class Uninstall extends BaseCommand<typeof Uninstall> {
4444
}
4545

4646
// uninstall app
47-
await uninstallApp(this.flags, this.sharedConfig.org, {managementSdk: this.managementAppSdk, log: this.log})
47+
for (const installationUid of this.flags['installation-uid']) {
48+
await uninstallApp(this.flags, this.sharedConfig.org, {managementSdk: this.managementAppSdk, log: this.log}, installationUid)
49+
}
4850
this.log(this.$t(uninstallAppMsg.APP_UNINSTALLED, { app: app?.name || this.flags["app-uid"] }), "info")
4951

5052
} catch (error: any) {

src/util/common-utils.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,9 @@ async function getStacks(
169169
return stacks;
170170
}
171171

172-
function uninstallApp(flags: FlagInput, orgUid: string, options: CommonOptions) {
172+
function uninstallApp(flags: FlagInput, orgUid: string, options: CommonOptions, installationUid: string) {
173173
const {managementSdk} = options;
174174
const app: unknown = flags['app-uid'];
175-
const installationUid: unknown = flags['installation-uid'];
176175
return managementSdk
177176
.organization(orgUid)
178177
.app(app as string)

src/util/inquirer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ async function getInstallation(
203203
installations = populateMissingDataInInstallations(installations, stacks)
204204
selectedInstallation = await cliux
205205
.inquire({
206-
type: 'search-list',
206+
type: 'checkbox',
207207
name: 'appInstallation',
208208
choices: installations,
209209
message: messages.CHOOSE_AN_INSTALLATION
@@ -217,7 +217,7 @@ async function getInstallation(
217217
log($t(uninstallAppMsg.UNINSTALLING_APP, {
218218
type: appType
219219
}), "info")
220-
220+
221221
return selectedInstallation;
222222
}
223223

0 commit comments

Comments
 (0)