Closed 0237h closed 3 weeks ago
Latest commit: e79d45cf383e8ce5d0ef4d4f617bad808dc8b808
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
After confirming that I want to use the existing directory it proceeds but then fails with Error: Directory or file "weth" already exists
. Should probably overwrite?
After confirming that I want to use the existing directory it proceeds but then fails with
Error: Directory or file "weth" already exists
. Should probably overwrite?
Fixed in #4eaf6a2 thanks.
Also fixed when using --from-example
flag.
@0237h I think we should delete all files from the directory. Othewise we could be mixing different projects and/or committing a bunch of unrelated files into subgraph repository, which is not great.
Unless you can think of a scenario where we would want to keep any old files in the directory we are overwriting.
I would argue that it could be more dangerous deleting files.
Right now, if you're not careful with the prompt, you'll end up overwriting/adding new files which isn't big deal. If we add deletion, one mistake and you could get files removed (any files).
Also there might be some use cases where you have ABIs in a subfolder that you might want to keep ? Not entirely sure but in any case I would avoid deleting files and letting the user do it. Otherwise they should use a new directory, not existing one.
Yes, I agree about deleting being dangerous. Although I'm still having hard time picturing when it would be useful to keep existing files in your repo.
The ideal flow would probably be checking if directory exists right after the prompt and requiring to enter the different directory name. We can still keep "overwrite yes/no" prompt when generating the project. Can be a separate issue if that's too much work.
If the user is choosing an existing directory for creating a new subgraph, ask for confirmation. If the answer is negative, abort the process.
Closes #1370