mario-eth / soldeer

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

Allow soldeer commands to run outside of the project root #145

Open beeb opened 3 weeks ago

beeb commented 3 weeks ago

Currently, soldeer assumes that the dependencies dir, the lock file, the foundry config file, the soldeer config file and the remappings file are localed in the current working directory. We could allow for more flexibility (running soldeer commands from a sub-directory) by traversing the file tree upwards until we find a foundry project root (a folder that contains a foundry.toml or soldeer.toml file), instead of using env::current_dir().

mario-eth commented 3 weeks ago

maybe a better idea is to have an arg? I'm not sure if traversing upwards is the right approach.

beeb commented 3 weeks ago

It's not a great UX if a user has to pass an additional arg if they want to run soldeer install package~version from the src or test directory (that's an example).

Besides, this is how foundry does it

mario-eth commented 3 weeks ago

Hmm, ok, then we should do it this way then.