diff --git a/.changeset/gorgeous-flies-teach.md b/.changeset/gorgeous-flies-teach.md new file mode 100644 index 000000000..7bdf5d287 --- /dev/null +++ b/.changeset/gorgeous-flies-teach.md @@ -0,0 +1,5 @@ +--- +'@graphprotocol/graph-cli': patch +--- + +show skip-git deprecation warning only when used diff --git a/packages/cli/src/commands/init.ts b/packages/cli/src/commands/init.ts index 70290dd05..45a8160cb 100644 --- a/packages/cli/src/commands/init.ts +++ b/packages/cli/src/commands/init.ts @@ -81,10 +81,6 @@ export default class InitCommand extends Command { 'skip-git': Flags.boolean({ summary: 'Skip initializing a Git repository.', default: false, - deprecated: { - message: - 'In next major version, this flag will be removed. By default we will stop initializing a Git repository.', - }, }), 'start-block': Flags.string({ helpGroup: 'Scaffold from contract', @@ -142,6 +138,12 @@ export default class InitCommand extends Command { initDebugger('Flags: %O', flags); + if (skipGit) { + this.warn( + 'The --skip-git flag will be removed in the next major version. By default we will stop initializing a Git repository.', + ); + } + const { node } = chooseNodeUrl({ node: nodeFlag, }); diff --git a/packages/cli/tests/cli/__snapshots__/init.test.ts.snap b/packages/cli/tests/cli/__snapshots__/init.test.ts.snap index 3791039df..17fbfbbc3 100644 --- a/packages/cli/tests/cli/__snapshots__/init.test.ts.snap +++ b/packages/cli/tests/cli/__snapshots__/init.test.ts.snap @@ -1,8 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`Init > Ethereum > From contract 1`] = ` -" › Warning: In next major version, this flag will be removed. By default we - › will stop initializing a Git repository. +" › Warning: The --skip-git flag will be removed in the next major version. By + › default we will stop initializing a Git repository. - Create subgraph scaffold Generate subgraph - Create subgraph scaffold @@ -37,8 +37,8 @@ Make sure to visit the documentation on https://thegraph.com/docs/ for further i `; exports[`Init > Ethereum > From contract with abi 1`] = ` -" › Warning: In next major version, this flag will be removed. By default we - › will stop initializing a Git repository. +" › Warning: The --skip-git flag will be removed in the next major version. By + › default we will stop initializing a Git repository. - Create subgraph scaffold Generate subgraph - Create subgraph scaffold @@ -73,8 +73,8 @@ Make sure to visit the documentation on https://thegraph.com/docs/ for further i `; exports[`Init > Ethereum > From contract with abi and structs 1`] = ` -" › Warning: In next major version, this flag will be removed. By default we - › will stop initializing a Git repository. +" › Warning: The --skip-git flag will be removed in the next major version. By + › default we will stop initializing a Git repository. - Create subgraph scaffold Generate subgraph - Create subgraph scaffold @@ -109,8 +109,8 @@ Make sure to visit the documentation on https://thegraph.com/docs/ for further i `; exports[`Init > Ethereum > From contract with index events and abi with ID in events 1`] = ` -" › Warning: In next major version, this flag will be removed. By default we - › will stop initializing a Git repository. +" › Warning: The --skip-git flag will be removed in the next major version. By + › default we will stop initializing a Git repository. - Create subgraph scaffold Generate subgraph - Create subgraph scaffold @@ -145,8 +145,8 @@ Make sure to visit the documentation on https://thegraph.com/docs/ for further i `; exports[`Init > Ethereum > From contract with list items in abi 1`] = ` -" › Warning: In next major version, this flag will be removed. By default we - › will stop initializing a Git repository. +" › Warning: The --skip-git flag will be removed in the next major version. By + › default we will stop initializing a Git repository. - Create subgraph scaffold Generate subgraph - Create subgraph scaffold @@ -181,8 +181,8 @@ Make sure to visit the documentation on https://thegraph.com/docs/ for further i `; exports[`Init > Ethereum > From contract with overloaded elements 1`] = ` -" › Warning: In next major version, this flag will be removed. By default we - › will stop initializing a Git repository. +" › Warning: The --skip-git flag will be removed in the next major version. By + › default we will stop initializing a Git repository. - Create subgraph scaffold Generate subgraph - Create subgraph scaffold @@ -217,8 +217,8 @@ Make sure to visit the documentation on https://thegraph.com/docs/ for further i `; exports[`Init > Ethereum > From example 1`] = ` -" › Warning: In next major version, this flag will be removed. By default we - › will stop initializing a Git repository. +" › Warning: The --skip-git flag will be removed in the next major version. By + › default we will stop initializing a Git repository. - Cloning example subgraph ✔ Cloning example subgraph - Initialize networks config @@ -251,8 +251,8 @@ Make sure to visit the documentation on https://thegraph.com/docs/ for further i `; exports[`Init > NEAR > From contract 1`] = ` -" › Warning: In next major version, this flag will be removed. By default we - › will stop initializing a Git repository. +" › Warning: The --skip-git flag will be removed in the next major version. By + › default we will stop initializing a Git repository. - Create subgraph scaffold Generate subgraph - Create subgraph scaffold