Cyfrin / foundry-devops

426 stars 53 forks source link

Updated Foundry DevOps installation steps #17

Closed Ikpong-Joseph closed 7 months ago

Ikpong-Joseph commented 8 months ago

Encountered errors with initial Foundry DevOps installation steps.

Problem 1:

forge rm forge-std -f
Error: 
git rm exited with code 128:
fatal: not removing 'lib/forge-std' recursively without -r

Solution:

git rm -rf lib/forge-std

Problem 2:

forge install foundry-rs/forge-std@v1.7.0
Installing forge-std in /home/xander/Repos/Decentralised-Marketplace/lib/forge-std (url: Some("https://github.com/foundry-rs/forge-std"), tag: Some("v1.7.0"))
Error: 
The target directory is a part of or on its own an already initialized git repository,
and it requires clean working and staging areas, including no untracked files.

Check the current git repository's status with `git status`.
Then, you can track files with `git add ...` and then commit them with `git commit`,
ignore them in the `.gitignore` file, or run this command again with the `--no-commit` flag.

If none of the previous steps worked, please open an issue at:
[Foundry GitHub Issues](https://github.com/foundry-rs/foundry/issues/new/choose)

Tried:

forge install foundry-rs/forge-std@v1.7.0 --no-commit
Installing forge-std in /home/xander/Repos/Decentralised-Marketplace/lib/forge-std (url: Some("https://github.com/foundry-rs/forge-std"), tag: Some("v1.7.0"))
fatal: 'lib/forge-std' already exists and is not a valid git repo
Error: 
git submodule exited with code 128

Solution:

rm -rf lib/forge-std

Then:

forge install foundry-rs/forge-std@v1.7.0 --no-commit

Corrected steps:

forge install Cyfrin/foundry-devops --no-commit
git rm -rf lib/forge-std
rm -rf lib/forge-std
forge install foundry-rs/forge-std@v1.7.0 --no-commit