Skip to content

Commit

Permalink
Accept all case diagnose send report confirm input (#711)
Browse files Browse the repository at this point in the history
We prompt the user with the following when running the diagnose tool:

```
Send diagnostics report to AppSignal? (Y/n):
```

When a user submits this with "Y", we do not accept it. This was because
the input checker only accepted for the lowercase value.

I've lowercased all input, so that "Y", "y", "N" and "n" all work like
they should in this confirmation prompt.

Part of appsignal/support#204
  • Loading branch information
tombruijn committed Jul 27, 2022
1 parent 902b9b2 commit fa13d19
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
bump: "patch"
type: "fix"
---

Accept uppercase input in diagnose tool send report prompt. When prompted to send the report when the diagnose tool, it will now also accept uppercase values like "Y" and "N".
2 changes: 1 addition & 1 deletion src/cli/diagnose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ export class Diagnose {
rl.question(
` Send diagnostics report to AppSignal? (Y/n): `,
async function (answer: string) {
switch (answer || "y") {
switch ((answer || "y").toLowerCase()) {
case "y":
await self.sendReport(data)
break
Expand Down

0 comments on commit fa13d19

Please sign in to comment.