rust-to-npm icon indicating copy to clipboard operation
rust-to-npm copied to clipboard

Cargo Doesn't Use Custom Package Name?

Open JimLynchCodes opened this issue 2 years ago • 2 comments

Hi again! 😃

I have a new exploration spike project now in which I am testing out the -n flag.

I deployed with this command:

rust-to-npm-cli deploy -b -n other-name-jims-rust-to-npm-cli-test

npm seems to work great. I install with:

npm i -g other-name-jims-rust-to-npm-cli-test

and then use it like this:

jims-new-rust-cli-test

For Cargo I would expect to be able to do this:

cargo install other-name-jims-rust-to-npm-cli-test

But instead, Cargo doesn't respect the -n flag. Instead, it wants me install with this:

cargo install jims-new-rust-cli-test

So, I am wondering... is it by design that the cargo package doesn't use the custom name? It is like an anti-pattern for me to want to do this in the first place? Or is it some limitation of cargo that you cannot publish with these two things having different names?

Just curious why it is like this because it seems unintuitive to me.

Thanks!

JimLynchCodes avatar May 17 '23 19:05 JimLynchCodes

@JimLynchCodes hi, by design we currently do not modify the cargo file. One option is we can pass in a temp file for the deployment or look into adding a flag to overwrite or modify in place.

j-mendez avatar May 17 '23 19:05 j-mendez

I don't like the idea of having the build actually modify the file. I'd prefer if it deployed a temp file. thanks

JimLynchCodes avatar May 18 '23 05:05 JimLynchCodes