cargo-dist icon indicating copy to clipboard operation
cargo-dist copied to clipboard

Unchecking homebrew should leave no trace of homebrew

Open alexanderjophus opened this issue 1 year ago • 2 comments

After running cargo dist init, I checked homebrew, then later realised I didn't need it yet.

I then ran cargo dist init again, unchecked homebrew, however the following was still in my Cargo.toml

# Config for 'cargo dist'
[workspace.metadata.dist]
# Publish jobs to run in CI
publish-jobs = ["homebrew"]

Similarly in CI the following step was still there publish-homebrew-formula (and depended on by announce

Open to input on whether it should fully take out the CI step - I think it should, but is there the use case of someone editing it and needing the edits later (could they just look at their git history?)

Also, if this is needed, I'd love to try contributing back!

alexanderjophus avatar Aug 02 '24 17:08 alexanderjophus

Oh this is a great catch!

This is where we currently apply the reverse logic of asking whether they want to enable homebrew publish. In this case I think we can automatically force it off instead of prompting, but the same basic logic that's here applies, just a bit reversed.

Instead of checking if homebrew is newly added we can check if homebrew is newly removed and then unconditionally strip the entry from publish_jobs if it's there.

https://github.com/axodotdev/cargo-dist/blob/7eeb4c3cd290d97f9c4b5e6252a9db33e8a13132/cargo-dist/src/init.rs#L738-L751

https://github.com/axodotdev/cargo-dist/blob/7eeb4c3cd290d97f9c4b5e6252a9db33e8a13132/cargo-dist/src/init.rs#L767-L773

Gankra avatar Aug 02 '24 18:08 Gankra

@Gankra I'm planning on attempting this this weekend (unless anyone else has given it a go). My rust isn't great, so please be patient 🤞

alexanderjophus avatar Aug 09 '24 10:08 alexanderjophus

merged!

Gankra avatar Aug 22 '24 17:08 Gankra