yonaskolb / Mint

A package manager that installs and runs executable Swift packages
MIT License
2.25k stars 121 forks source link

mint which usage #266

Open brzzdev opened 1 year ago

brzzdev commented 1 year ago

Hi,

I'm trying to use mint which in a script to get the executable path. It seems like I can either get the output including the loading string

mint which example
🌱 Finding latest version of example
/path/example

which isn't useful in this instance

or I use -s which I would expect to just strip the loading string, but instead I get an empty string

mint which example -s

Am I missing something?

yonaskolb commented 1 year ago

Hmm, silent does stop all standard out, and there's currently no way to prevent the loading message, other than if you locked down the version of example (either by a Mintfile or by providing the version with mint which example@1.0.0). This will also make the command faster, as it doesn't have to hit the network.

Alternatively you can run some other command after to just get the last line like mint which example | tail -n 1