Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/gorgeous-flies-teach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphprotocol/graph-cli': patch
---

show skip-git deprecation warning only when used
10 changes: 6 additions & 4 deletions packages/cli/src/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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,
});
Expand Down
32 changes: 16 additions & 16 deletions packages/cli/tests/cli/__snapshots__/init.test.ts.snap
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading