velodrome-finance / v1

Velodrome Finance v1 Smart Contracts
https://v1.velodrome.finance
47 stars 81 forks source link

Issue initialzing with Foundry #4

Open CarsonCase opened 1 year ago

CarsonCase commented 1 year ago

Pretty new to Foundry so go easy on me here if I'm just missing something obvious.

But Foundry isn't initializing dependencies with this readme and not with forge install either. From what I can find in the forge documentation it should use the submodules to install dependancies in lib/ once forge install is called. And these are defined in .gitmodules. I can copy paste the data in there 1 by 1 and get it installed. But I imagine the issue here is that if you use forge init --force and you do need to use the force flag, then a new lib/ folder is created without the submodules even though they're defined in the root folder.

May need to publish the project post forge-init to be cloned with the submodules, or if that's too crowded include a script to

for module in submodules:
      forge install module.url
duncan4123 commented 1 year ago

does this script help?

!/bin/sh

set -e

git config -f .gitmodules --get-regexp '^submodule..*.path$' | while read path_key path do url_key=$(echo $path_key | sed 's/.path/.url/') url=$(git config -f .gitmodules --get "$url_key") git submodule add $url $path done