mario-eth / soldeer

Solidity Package Manager written in rust
MIT License
188 stars 19 forks source link

Commands spawned twice and panic on fail #153

Open DaniPopes opened 2 weeks ago

DaniPopes commented 2 weeks ago

A lot of Command::new are spawned twice as .status() and .output() internally spawn a process and wait for it to complete. Only one should be used .output() which also contains .status.

They also panic after completion if an error occurred when spawning the command by using .expect().

Eg. https://github.com/mario-eth/soldeer/blob/660b6c95e33965e532dabedce30d0e48c5d174bc/src/dependency_downloader.rs#L220-L230

Note that .status and .output have different output capturing semantics, mainly that .status pipes and .output captures into fields, so this also has to be kept in mind.

mario-eth commented 2 weeks ago

Thanks for the comment, i was never happy how i was dealing with status/output, i have to work a bit around it.

beeb commented 2 days ago

Will be fixed in 0.4.0 I guess, this has all been refactored