Commit 14490e7
authored
fix(setup): show actual shell name instead of "unknown" for unsupported shells (#287)
## Problem
When an unsupported shell (e.g. xonsh) is detected during \`sentry
setup\`, the completions message shows the literal string \`unknown\` —
the internal \`ShellType\` value — rather than the actual shell binary
name from \`\$SHELL\`:
```
Completions: Your shell (unknown) is not directly supported
```
## Solution
Add a \`name\` field to \`ShellInfo\` populated from
\`basename(\$SHELL)\` at detection time, and use it in the user-facing
message:
```
Completions: Your shell (xonsh) is not directly supported
Installed bash completions as a fallback: ~/.local/share/bash-completion/completions/sentry
```
When \`\$SHELL\` is unset, \`name\` falls back to the type string.
## Changes
- `src/lib/shell.ts` — `name` field added to `ShellInfo`, populated in
`detectShell()`
- `src/commands/cli/setup.ts` — use `shell.name` in unsupported/fallback
messages
- `test/commands/cli/setup.test.ts` — assert on the real shell name1 parent 30faf6f commit 14490e7
File tree
3 files changed
+8
-4
lines changed- src
- commands/cli
- lib
- test/commands/cli
3 files changed
+8
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | | - | |
| 191 | + | |
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
196 | | - | |
| 196 | + | |
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| |||
129 | 131 | | |
130 | 132 | | |
131 | 133 | | |
| 134 | + | |
132 | 135 | | |
133 | 136 | | |
134 | 137 | | |
135 | 138 | | |
136 | 139 | | |
| 140 | + | |
137 | 141 | | |
138 | 142 | | |
139 | 143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
323 | 323 | | |
324 | 324 | | |
325 | 325 | | |
326 | | - | |
| 326 | + | |
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
349 | | - | |
| 349 | + | |
350 | 350 | | |
351 | 351 | | |
352 | 352 | | |
| |||
0 commit comments