Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Handle plain strings in --sync-aliases #25

Merged

Conversation

hanna-kruppe
Copy link
Contributor

First of all, thanks for creating this tool!

Currently, cargo bin --sync-aliases panics with a very unhelpful message (unwrap failed) when it encounters an alias defined as a single string. This form is valid and not that uncommon, so users might have that in their config even if cargo-run-bin always creates the array form. I ran into this once myself in the past, fixed it by changing my config.toml, and promptly forgot about it. Until I had to help a colleague debug the same problem a few days ago, so I decided to fix it properly. While I was at it, I also turned other nearby unwrap()s into error messages to avoid similarly bad UX with other unexpected (likely invalid) aliases.

hanna-kruppe and others added 2 commits November 21, 2024 19:55
It's valid and not that uncommon to have an alias specified by a single
string. So far, cargo-run-bin panics with a very unhelpful message when
it counters that. This commit fixes that. While I was at it, I also
turned other nearby unwrap()s into error messages to avoid similarly
bad UX with other unexpected (likely invalid) config.toml contents.
@dustinblackman
Copy link
Owner

Thanks for this, appreciate it!

@dustinblackman dustinblackman merged commit 3c4d168 into dustinblackman:master Nov 24, 2024
3 of 4 checks passed
@hanna-kruppe hanna-kruppe deleted the sync-aliases-reliably branch November 24, 2024 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants