Improve validation of user provided path
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
Start in cmd/install.go around line 39 and internal/discord/paths.go around line 78 to trace how --path is checked against discovered paths. Reproduce the shown bdcli install command, then inspect how package.json existence or content can validate the supplied path. Done means a valid manual path is accepted when internal path resolution fails, while invalid paths still produce the existing error.
Written by the indexing model from the issue text.
Description
Currently bdcli expected the --path given by user matched in the discovered list of paths
Which causing manual path would fail when the internal path resolution failed
$ bdcli install -p ~/.config/discord/app-1.0.137/modules/discord_desktop_core-1/discord_desktop_core/
Error: could not find a valid Discord installation at ***/.config/discord/app-1.0.137/modules/discord_desktop_core-1/discord_desktop_core/
Usage:
bdcli install [flags]
Aliases:
install, reinstall
Flags:
-c, --channel string Discord release channel (stable|ptb|canary) (default "stable")
-h, --help help for install
-p, --path string Path to a Discord installation
Global Flags:
--silent Suppress non-error output
could not find a valid Discord installation at ***/.config/discord/app-1.0.137/modules/discord_desktop_core-1/discord_desktop_core/
Suggestion:
Validate the --path by checking the existence of package.json or even the content of it
Related to: https://github.com/BetterDiscord/cli/issues/8#issuecomment-4393432539
- Dominant language
- Go
- Stars
- 22
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from BetterDiscord/cli
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
BetterDiscord/cli#8 · 11 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
BetterDiscord/cli#13 ·
All issues in BetterDiscord/cli
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
enhancement needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
kind/cleanup
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
kubernetes-sigs/kueue#15947 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sympozium-ai/sympozium#627 ·