Skip to content

Conversation

mikeland73
Copy link
Contributor

Summary

Adds --no-prefix flag to generate aliases for scripts without a prefix.

How was it tested?

devbox gen alias --no-prefix
build

@mikeland73 mikeland73 requested review from savil and LucilleH April 19, 2024 21:28
@@ -210,7 +216,7 @@ func genAliasCmd() *cobra.Command {
}
re := regexp.MustCompile("[^a-zA-Z0-9_-]+")
prefix := cmp.Or(flags.prefix, box.Config().Root.Name)
if prefix == "" {
if prefix == "" && !flags.noPrefix {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return usererr.New(
					"To generate aliases, you must specify a prefix or set a name " +
						"in devbox.json, or use `--no-prefix` flag")

?

@mikeland73 mikeland73 merged commit 638eb75 into main Apr 20, 2024
@mikeland73 mikeland73 deleted the landau/add-no-prefix branch April 20, 2024 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants