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

Add hint to use --replace flag when not explicitly replacing a release #26

Closed
wants to merge 1 commit into from

Conversation

Pi-Cla
Copy link
Contributor

@Pi-Cla Pi-Cla commented May 5, 2024

Copy link
Member

@lpil lpil left a comment

Choose a reason for hiding this comment

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

We can't talk about the CLI here because this isn't the CLI. For example, if I were to make a web app using this library I wouldn't want it to talk about --replace in its JSON API or logs.

@Pi-Cla
Copy link
Contributor Author

Pi-Cla commented May 6, 2024

We can't talk about the CLI here because this isn't the CLI. For example, if I were to make a web app using this library I wouldn't want it to talk about --replace in its JSON API or logs.

Alright I will close this and open a different PR on the gleam cli. But first, what is the purpose of this line?

if body.contains("--replace") {

At first glance this looks like something specific to gleam cli which would make me think it was alright to just directly modify the error message here instead of having to alter it at the gleam cli level.

@lpil
Copy link
Member

lpil commented May 8, 2024

The Hex API is unfortunately not very well designed. It was an implementation detail of Elixir's Mix build tool and as such makes references to Mix's CLI API in errors so the build tool can just print whatever is returned. It's also largely undocumented, to add to the fun.

This library deliberately hides away these issues to make it more suitable for third-party use. Note this is not a specifically Gleam CLI library. If it was it wouldn't be its own repo and package.

@Pi-Cla Pi-Cla closed this May 8, 2024
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.

gleam publish: Show hint about republishing instead of hexpm library error
2 participants