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

Directory already exists when trying to initialize a subgraph and point it to an existing directory

Open schmidsi opened this issue 2 years ago • 0 comments

Which packages are impacted by your issue?

@graphprotocol/graph-cli

Describe the issue

When I initialize a new subgraph and select the current directory as "Directory to create the subgraph in", it fails with

❯ Directory already exists

I think it is a valid use-case to create a subgraph in an existing directory. For example, when I need to store the ABI somewhere first, I create a folder to place the ABI. Now, I want to init the subgraph in this folder and not in another subfolder.

Maybe a confirm would do the trick? Like: "This directory already exists. Are you sure you want to initialize the subgraph there? This might have unforeseeable consequences"

Reproduction

https://thegraph.com

Steps to Reproduce the Bug or Issue

graph init --studio base-token2 ✔ Protocol · ethereum ✔ Subgraph slug · base-token2 ? Directory to create the subgraph in › .

Expected behavior

Warning or just do it

Screenshots or Videos

No response

Platform

  • OS: maxOX 13.2.1 (22D68)
  • NodeJS: v18.15.0
  • @graphprotocol/* version(s): @graphprotocol/graph-cli/0.50.1 darwin-arm64 node-v18.15.0

Subgraph Manifest

No response

Subgraph GraphQL Schema

No response

Additional context

No response

schmidsi avatar Jun 09 '23 15:06 schmidsi