graph-tooling icon indicating copy to clipboard operation
graph-tooling copied to clipboard

Check if directory already exists in `graph init` when directory is entered

Open schmidsi opened this issue 1 year ago • 1 comments

Following walk through:

graph init
 ›   Warning: In next major version, this flag will be removed. By default we will
 ›   stop initializing a Git repository.
✔ Network · Base Mainnet · base · https://base.blockscout.com
✔ Source · Smart Contract · ethereum
✔ Subgraph slug · blonde-subgraph
✔ Directory to create the subgraph in · blonde-subgraph
✔ Contract address · 0x28BC44F9754f590DA1564C1A7bA35F8E1d1B134A
✔ Fetching ABI from contract API...
✔ Fetching start block from contract API...
✔ Fetching contract name from contract API...
✔ Start block · 22855106
✔ Contract name · Blonde
✔ Index contract events as entities (Y/n) · true
✖ Directory already exists, do you want to initialize the subgraph here (files will be overwritten) ? (y/N) · false

n ›   Error: no error?

I'd expect that in step "Directory to create the subgraph in" it would check if that directory exists and give a warning, not at the end.

Also, the "Error: no error?" is a bit a weird ending.

schmidsi avatar Dec 18 '24 15:12 schmidsi

@schmidsi can you think of a use case where you would answer "yes" to that question?

I think I would prefer to just disallow using existing directory and accept only the one that doesn't exist.

YaroShkvorets avatar Dec 20 '24 22:12 YaroShkvorets