Skip to content

Commit ed4544d

Browse files
Ensure more orderly deletion of triggers (#249)
Incorporates deployer 4.3.9, declares version 4.2.7.
1 parent 21d006c commit ed4544d

File tree

3 files changed

+24
-11
lines changed

3 files changed

+24
-11
lines changed

package-lock.json

+9-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nimbella/nimbella-cli",
3-
"version": "4.2.6",
3+
"version": "4.2.7",
44
"description": "A comprehensive CLI for the Nimbella stack",
55
"main": "lib/index.js",
66
"repository": {
@@ -17,7 +17,7 @@
1717
"@adobe/aio-cli-plugin-runtime": "github:nimbella/aio-cli-plugin-runtime#v2021-11-19-1",
1818
"@adobe/aio-lib-core-config": "^2.0.0",
1919
"@adobe/aio-lib-runtime": "^3.3.0",
20-
"@nimbella/nimbella-deployer": "4.3.8",
20+
"@nimbella/nimbella-deployer": "4.3.9",
2121
"@nimbella/storage": "^0.0.7",
2222
"@oclif/command": "^1",
2323
"@oclif/config": "^1",

src/commands/action/delete.ts

+13
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,19 @@ export default class ActionDelete extends NimBaseCommand {
2121
const creds = await getCredentials(authPersister).catch(err => logger.handleError('', err))
2222
const owClient = openwhisk(creds.ow)
2323
const deletedAction = await deleteAction(arg, owClient)
24+
if (Array.isArray(deletedAction)) {
25+
const errors = deletedAction as Error[]
26+
// We have tried using AggregateError here but ran into perplexing problems. So, using an ad hoc approach
27+
// when combining errors.
28+
if (errors.length > 1) {
29+
const combined = Error('multiple errors occurred while deleting an action') as any
30+
combined.errors = errors
31+
throw combined
32+
}
33+
if (errors.length === 1) {
34+
throw errors[0]
35+
}
36+
}
2437
if (flags.json) {
2538
logger.logJSON(deletedAction)
2639
}

0 commit comments

Comments
 (0)