Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Commit e9942f5

Browse files
committed
fix: convert prompt empty array to null
1 parent df063d6 commit e9942f5

3 files changed

Lines changed: 9 additions & 1 deletion

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@livechat/dev-cli",
3-
"version": "1.0.0-alpha.1",
3+
"version": "1.0.0-alpha.2",
44
"description": "This project exposes LiveChat Developer Console capabilities in form of easy to use CLI application.",
55
"publishConfig": {
66
"access": "public"

src/prompts/chat-webhook-actions.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,9 @@ export async function getChatWebhookActionsPrompt() {
1414
},
1515
])
1616

17+
if (actions?.length === 0) {
18+
return null
19+
}
20+
1721
return actions
1822
}

src/prompts/scopes.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ export async function getScopesPrompt() {
1616
choices: allScopes.map((s) => ({ value: s.scope, title: s.scope })),
1717
})
1818

19+
if (scopes?.length === 0) {
20+
return null
21+
}
22+
1923
return scopes
2024
} catch (error) {
2125
loader.stop()

0 commit comments

Comments
 (0)